title: Java: When is a static initialization block useful?
body: <p>What's the difference between initialization within a <code>static</code> block:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class staticTest {
  
      static String s;
      static int n;
      static double d;
  
      static {
          s = "I'm static";
          n = 500;
          d = 4000.0001;
      }
      ...
  </code></pre>
  
  <p>And individual static initialization:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class staticTest {
  
      static String s = "I'm static";
      static int n    = 500;
      static double d = 4000.0001;
  
      ....
  </code></pre>