1. When you run a class using the Java.exe command
Java.exe person
2. When you create an object of a class
Person P=new person ();
3. Accessing static member variables in a class (Assignment/Get value)
System.out.println (Person.classname);
4. Accessing static member methods in a class
Person.method ();
5. When you create a subclass object of a class
Student s=new Student ();
6. Use reflection to force the creation of a Java.lang.Class object for a class or interface
System.out.println (Person.class);//(static code block not loaded)
The sixth method does not complete the three-step load of the class during the reflection process (load, join, initialize), so static blocks of code in the class cannot be executed, and the rest of the methods can implement static blocks of code.
Static code block loading problem during Java EE initialization