title: Static variable initialization in Constructor java
body: <p>i want to understand from the below code y the value of static variable b was not initialized and though the value was initialized in the constructor.</p>
  
  <pre><code>public class A {
         private static B b = null;
         public A() {
             if (b == null)
               b = new B();
         }
  
         public static void main(String[] args) {
             b.func();
         }
      }
  </code></pre>
  
  <p>Thanks
  Punith</p>