java : accessing static variables inside static block
<p>Analyzing some weird scenario in following static block :</p>

<pre><code>static {
  System.out.println("Inside Static Block");
  i=100; // Compilation Successful , why ?
  System.out.println(i); // Compilation error "Cannot reference a field before it is defined"
}

private static int i=100;
</code></pre>

<p>While same code is working fine while using :</p>

<pre><code>static {
  System.out.println("Inside Static Block");
  i=100; // Compilation Successful , why ?
  System.out.println(MyClass.i); // Compiles OK
}

private static int i=100;
</code></pre>

<p>Not sure why variable initialization do not need variable access using class name while SOP requires ?</p>
