(1) Initialize:
So if the inheritance relationship is: A export B and then export C, the order in which the C objects are created is:
* (1) A the static domain, B the static domain, C the static domain;
* (2) A the non-static domain, A the constructor, B the non-static domain, B the constructor, C the non-static domain, C the constructor
(2) Cleaning:
The order of destruction should be reversed from the order of initialization.
(3) Super/this
The method of the parent class can be called through the Super keyword in a subclass. You can also call your own method through the This keyword.
In the constructor, however, the super and the This keyword can exist only one, and are placed in the first sentence of the constructor function.
If c inherits from B,b and inherits from a, if you want to call the method of a in C method, it is not feasible to try to call through Super.super.method () only by creating an object of a, because Super does not allow two or more consecutive calls.
Java Fundamentals: Initialization and cleanup