In order to invoke the static main method (or any other method for that matter) the class has to be loaded in the JVM. At that point, the static variables get initialized, and the static initializer blocks execute. Creating instances of the class is not required for the static blocks to execute, and creating instances of the class will not cause the static blocks to execute again.
What's happening behind the scenes is that the JVM creates an instance of the Class class that represents the StaticTest class. There is only one Class instance for StaticTest, and that one instance is what holds all the static variables, static methods, and static initializer blocks. Creating instances of StaticTest has no effect on the sole instance of Class that holds all that static stuff relating to StaticTest.
SCJA 1.0 (98%), SCJP 1.4 (98%)
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads