singleton-early initialization ,static field initialization and class loading
<p>Conside this code:</p>

<pre><code>class MyClass {
    private static MyClass myobj = new MyClass();

    private MyClass() {
    }

    public  static MyClass getMyobj() {
        return myobj;
    }
}
</code></pre>

<p>1)IN above code when will <code>myobj</code> get initialiazed-when <code>Myclass</code> gets loaded OR when <code>getMyobj()</code> will be called first time as <code>MyClass.getMyobj();</code>?</p>

<p>2) Suppose we call twice as:</p>

<pre><code>MyClass.getMyobj();
MyClass.getMyobj();
</code></pre>

<p>will it create new <code>MyClass()</code> object on second call? </p>
