title: Default Constructor is getting executed before Static block in java
body: <p>When we load a class in java, first <strong>static block</strong> get executed and then <strong>default constructor</strong>. but in below peace of code, What I observed that <strong>default constructor</strong> is getting executed before static block.</p>
  
  <pre><code>    public class Hello {
  
      private static Hello hello = new Hello();
  
      public Hello() {
          System.out.println("Hello Default Constructor");
      }
  
      static {
          System.out.println("Hello Static Block");
      }
  
      public static Hello createHelloInstance() {
          return hello;
      }
  }
  </code></pre>
  
  <p>Main Class: </p>
  
  <pre><code>   public class MainTest {
  
          public static void main(String a[])
          {
              Hello.createHelloInstance();
          }
      }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Hello Default Constructor
  Hello Static Block
  </code></pre>
  
  <p>I need to know the fundamental concept behind that. what is that so happening. ?
  Could someone help me to understand the flow behind that.</p>