 <p>Its is just because of <code>Class.forName()</code> is dynamically loaded at run time your class into memory(RAM). and it will execute all static block within this class without creating reference of that class,</p> <p>From offical doc:</p> <blockquote> <p>A call to Class.forName("X") causes the class named X to be dynamically loaded (at runtime). A call to forName("X") causes the class named X to be initialized (i.e., JVM executes all its static block after class loading). Class.forName("X") returns the Class object associated with the "X" class. The returned Class object is not an instance of the "x" class itself.</p> <p>Class.forName("X") loads the class if it not already loaded. The JVM keeps track of all the classes that have been previously loaded. This method uses the classloader of the class that invokes it. The "X" is the fully qualified name of the desired class.</p> </blockquote> <p>here is more information about it: <a href="http://www.xyzws.com/Javafaq/what-does-classforname-method-do/17" rel="nofollow">http://www.xyzws.com/Javafaq/what-does-classforname-method-do/17</a></p>