title: How JVM loads parent classes in Java
body: <p>Code:</p>
  
  <pre><code>class A {
      static {
          System.out.println("loading A static 1");
      }
      static {
          System.out.println("loading A static 2 B.c= "+B.c);        
      }
      static {
          System.out.println("loading static 3");
      }
      static int a=10; 
      A(){        
      }
  }
  
  class B extends A{
      static {
         System.out.println("loading B A.a= "+A.a);
      }
      static int c = 50;
  }
  public class Test {
      public static void main(String[] args) {
          new B();
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>loading A static 1
  loading A static 2 B.c= 0
  loading static 3
  loading B A.a= 10
  </code></pre>
  
  <p>From this out put can we say that the parent class loads after the child class but child class initialize after the parent class?
  If so how JVM loads class hierarchies?</p>