The first is my understanding of the concept of inheritance, the so-called inheritance is on the basis of existing classes to create a new subclass, the inherited class is called the superclass or the parent class. Subclasses have some properties, the first subclass inherits the parent class's domain and method, so-called inheritance can call the method in the parent class through the subclass, and the second subclass can overwrite the method (override) of the parent class as needed; Thirdly, when we call a method in a superclass in a subclass, we cannot invoke the keyword (supper) directly;
In inheritance this chapter is polymorphic in one important point of knowledge, and an object variable can indicate a variety of actual types of phenomena called polymorphism. A superclass can reference an object of any subclass, but it cannot assign a reference to a superclass to a subclass object.
One more difficult thing to understand here is a code for a generic array list:
Arraylist<employee> staff=new arraylist<employee>;
annotating This code is /* declares and constructs a list of generic arrays that hold employee objects;
The greatest advantage of a generic array list is the ability to store information dynamically, saving memory space.
201671010144 2016-2017 "Java Programming" I understand the inheritance!