Detailed explanation of inheritance of java basic tutorial
Inheritance is an important object-oriented concept. Inheritance is another important way to improve code reusability besides composition. We can see in composition that composition is the functional interface of repeatedly calling objects. We will see that inheritance can reuse existing class definitions.
We have mentioned in constructing method and method overloading that Java judges the method to be called through method name and parameter list at the same time. Method is determined by method name and parameter list. In the above problem, if only the method name is the same and the parameter list is different, the two methods will be presented to the interface at the same time, which will not cause us trouble. When calling externally, Java will decide which method to use (method overload) according to the provided parameters.
2. After the base class object is created, start to build the derived layer (initialize the derived layer members). This is the same as the general construction method. Refer to the construction method and method overload