1 Operations on Property assignment: (1) default initialization (2) explicit initialization or code block initialization (here two structures are executed sequentially) (3) in the constructor
(4) Modify the corresponding properties of the object by means of the method
2 initialization block (code block): If there is a decoration, you can only use static
3 non-static code block: (1) You can initialize the properties of a Class (2) You can have output statements
(3) A class can have multiple non-static code blocks, executed sequentially (4) Every object that creates a class, a non-static block of code is created once (5) It executes earlier than the construction method
4 Static code block (1) There can be output statements (2) with the class loaded, can only be loaded once
(3) executed sequentially, before non-static code block (4) static code block cannot execute non-static methods and properties
Non-static and static initialization blocks