2. Static keyword
Variables: Static variables exist in memory only one copy, only initialized once when the class is first instantiated, and all instances of the class share static variables, you can access the class name directly.
Method: The static method exists when the class is loaded, and it does not depend on any instance, so the static method must be implemented, that is, it cannot be an abstract method.
Static code blocks: static blocks, like static methods, run once on the first instantiation of a class.
Initialization order: Static variable (parent class), Static code block
(subclass) static variable, static code block
(parent Class) non-static variable, non-static code block
(parent Class) constructor method
(subclass) Non-static variable, non-static code block
(subclass) Construction method
Java Foundation 2 static keyword