From the
Java Language Specification (section 12.4.1 of the Third Edition
Initialization of a class consists of executing its static initializers and the initializers for static fields declared in the class. Initialization of an interface consists of executing the initializers for fields declared in the interface.
...
A class or interface type T will be initialized immediately before the first occurrence of any one of the following:
T is a class and an instance of T is created. T is a class and a static method declared by T is invoked. A static field declared by T is assigned. A static field declared by T is used and the field is not a constant variable (�4.12.4). T is a top-level class, and an assert statement (�14.10) lexically nested within T is executed.
Invocation of certain reflective methods in class Class and in package java.lang.reflect also causes class or interface initialization. A class or interface will not be initialized under any other circumstance.
Because the static member "x" is declared in A and not in C, only A and D need to be (or will) be initialized in Satish's example -- even though A, B, C, and D are all loaded.
Likewise, in Sonny's example, none of these conditions are met for C, so C isn't initialized, and therefore neither are any of its parents. Actually using the C.class object for something may trigger initialization.