title: Creating an object in a static way
body: <p>Could anyone explain how Java executes this code? I mean the order of executing each statement.</p>
  
  <pre><code>public class Foo
  {
      boolean flag = sFlag;
      static Foo foo = new Foo();
      static boolean sFlag = true;
  
      public static void main(String[] args)
      {
          System.out.println(foo.flag);
      }
  }
  </code></pre>
  
  <p><strong>OUTPUT:</strong></p>
  
  <pre><code>false
  </code></pre>