The entry point into a program in java is typically something like this
// MyMain.java
public class MyMain{
//whatever
public static void main(String args[]){
System.out.println("balderdash");
}
}
However, since there is only the one SOP in main, the above class may be like this instead
// MyMain.java
public class MyMain{
//whatever
static {
System.out.println("balderdash");
}
}
One obvious advantage to using main(...) is that arguments may be passed in to the program. Another ( I'm guessing here ) may have to do with the garbage collecter treating objects created within a static block differently.
What other benefits come from using the language-defined entry-point - public static void main( String args[] ) instead of using a static initializer.
p.s. The above snippets are for illustration only, and may not be compilable