title: Can we initialise static variable inside constructor?
body: <p>I have the following code snippet:</p>
  
  <pre><code>class Constructor {
  
    static String str;
  
    public void Constructor() {
        System.out.println("In constructor");
        str = "Hello World";
    }
  
    public static void main(String[] args) {
        Constructor c=new Constructor();
        System.out.println(str);
    }
  }
  </code></pre>
  
  <p>Its output is null even though the string is initialized inside the constructor.</p>
  
  <p>Why is that so?</p>