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 ?
For example:
public class MyClass {
static {
AnotherClass object = new AnotherClass();
// Do Some operations here with object.
}
}