Properties, methods, construction methods, and free blocks are members of the class, and the order in which members of the class are executed when the object of the class is created:
1. Static and static initialization of the parent class is fast and executes sequentially in the order in which they appear in the code.
2. Subclass static members and static initialization blocks, executed sequentially in the order in which they appear in the code.
3. Instance members and instance initialization blocks of the parent class are executed sequentially in the order in which they appear in the code.
4. Execute the constructor method of the parent class.
5. Subclass instance members and instance initialization blocks, executed sequentially in the order in which they appear in the code.
6. Execute the constructor method of the subclass.
Similar to the initialization order of C #, the difference is that there is no block in C #, and field initialization is done in constructors.
Initialization Order of Java classes