title: What is the purpose/advantage of a static{} block?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2420389/static-initialization-blocks">Static Initialization Blocks</a>  </p>
  </blockquote>
  
  
  
  <p>While reviewing some old code, I found some rather odd syntax that I've never seen before.  After doing some research, I know now that what I saw was a <code>static{}</code> block which (if I understand correctly) is a block of code that is executed at initialization time.</p>
  
  <p>What I don't understand is the advantage to having such a feature or when one would possibly want to use this.  It seems like the static blocks simply contain regular lines of code which could belong in any regular static <em>method</em>, so what is the advantage to having it run automatically at initialization (other than saving a programmer a line of code to call a method)?  Why is this important or useful?</p>