On static and non-static initializing blocks in Java
<p>I originally thought that static blocks were for static variables but the compiler allows both A and B to compile and run, what gives?<br />
<strong>A</strong></p>

<pre><code>   private static final Map&lt;String,String&gt; m = new HashMap&lt;String,String&gt;();

        {
            m.put("why", "does");
            m.put("this","work");
        }
</code></pre>

<p><strong>B</strong></p>

<pre><code> private static final Map&lt;String,String&gt; m = new HashMap&lt;String,String&gt;();

        static{
               m.put("why", "does");
               m.put("this","work");
             }
</code></pre>

<p>Running <code>System.out.println(Main.m.toString());</code> for <strong>A</strong> prints </p>

<blockquote>
  <p>{} </p>
</blockquote>

<p>but running the same for <strong>B</strong> prints out in Yoda-speak</p>

<blockquote>
  <p>{this=work, why=does}</p>
</blockquote>
