title: What are the advantages and disadvantages of creating an Object in static block in Java?
body: <p>This question might be blunder to some of the Java Experts. But I would like to know why we create the objects in a static method like main but not in static block. 
  I understand that its going to create the object unnecessarily if we instantiate in static block and of course if we don't use it further. Are there any other things that are to be noted with this approach ? Can we relate this with Singleton Pattern ?</p>
  
  <p>For example: </p>
  
  <pre><code>public class MyClass {
  
      static {
          AnotherClass object = new AnotherClass();
              // Do Some operations here with object.
      }
  }
  </code></pre>