I know there are lot of questions on Singleton pattern. But here what I would like to know about the output which might also cover how \"static\" works in Java.
Class gets loaded and initialized first by classloader of JVM. And JVM while initializing, scans the class (Singleton) and while doing that it initializes static variable which is in the first line. That variable calls the constructor and prints line in it. Once class is initialized, it will invokes main method and hence prints the statement inside it.