The static method is executed when you call it manually.
Static variables are loaded with the class, with the highest precedence. Class loading executes
Then there is the static initializer (only static member variables are initialized ). class loading executes
Then, the property is initialized (only non-static member variables are initialized). New object is executed when the
Finally, the constructor. The new object is executed.
Object creation Process:
For the first time (new creates an object or calls a static property or static method), find the classpath to locate the class file, load the class file, and initialize all the static properties.
Second, only when the object is created, the storage space is opened up, and then the storage space sets the default value for the object and then initializes it according to the field setting value.
Last execution constructor
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Order of various property invocations in Java