I believe that the static initializers are executed when the class is loaded. When is this class loaded, so that static initializers are executed? Especially if no instance of the class is created? Consider code -
The object of class TestInitializers0 is *NOT* constructed, only its reference is declared in main, but the class does not get loaded. What gets the class loaded w/o creating its instance? This is required because you may want to do the initialization in the static initializer and use static values with the class referece itself, w/o creating an object. TIA, - Manish