Mechanisms required for dynamic binding
1. Identify the object type during execution
2. Call the corresponding function
In addition to the final modifier, functions in Java use dynamic binding.
Of course, constructor is an exception, and it has no polymorphism.
The formation process of a complex object that contains inheritance and combination is as follows:
1. Allocate heap space and perform automatic initialization. Set all to binary zero.
2. Call the constructor of the direct parent class of the current class cyclically
Until the parent class of the current class is object
Performs Explicit initialization of the current class member, executes the constructor of the current class, and returns to its direct subclass.
This repeats until the last subclass is returned.
Note: The subclass cannot display and initialize the parent class members.