initialization order for multiple inheritance relationships
Parent Class Property---"Parent construction method---" Subclass attribute---"Subclass construction method
Note: When an object is created, the subclass constructor automatically invokes the constructor of the parent class, and if the subclass has a parameter construct, the parent class parameterless construct is not automatically invoked. The subclass must have an parameterless construct, or an error occurs when the object is created using an parameterless constructor. If the parent class property is not initialized, the parent class property is not invoked and the contents of the parent class construction method are directly gone. Then continue with the constructor method of the subclass. Similarly, if the attribute in the subclass is not initialized, the attribute is not taken, that is, the method body in the constructor method of the subclass is directly taken.
The constructor method is not overridden because it cannot be inherited.
method Overrides rule: The method name is the same; The argument list is the same; the return value type is the same or is its subclass; Access rights are not strict with the parent class
Super keyword to access members of the parent class
super can only appear in the method and construct method of subclasses
when Super calls the constructor method, it can only be the first sentence
Super cannot access the private property of the parent class
Abstract can also be used for methods---abstract methods
Abstract method has no method body
abstract methods must be in an abstract class
an abstract method must be implemented in a subclass unless the subclass is an abstract class
final modifier
the decorated class, which can no longer be inherited
modified method, cannot be overridden by a quilt class
the modified variable becomes a constant and can only be assigned when it is initialized.
abstract classes and abstract methods
abstract class cannot be instantiated
can have 0-multiple abstract methods
non-abstract classes must override all abstract methods of the parent class.