1. Upward transformation
- The handle class reference is treated as a parent class reference. (The subclass object is assigned to the parent class reference)
2. Binding
- Determines which class the method belongs to.
3. Early binding
- The program is bound before execution.
4. Late binding is also called dynamic binding
- The program is run-time bound.
5. Constructors and polymorphic
5.1 Domains and static methods (including constructors) are not polymorphic.
5.2 Constructors can be polymorphic, calling methods that are overridden in subclasses, but not secure.
5.3 Methods within a constructor can be safely called only the final method of the base class.
Knowledge points
- Private methods are overwritten and are independent of the base class, and new methods that belong to the subclass are just the same as the base class private methods.
- The cleanup order is the opposite of the initialization order.
- This represents a reference to this object.
- In addition to the final static private method, the other methods are dynamic bindings.
- Compilation compiles Java files into class files, each of which is a class file, including an inner class. The first time the class file is loaded with code, the class file is loaded only once.
The Java programming thought note Eighth chapter polymorphism