The
Java VM expects the function with signature
public static void main(String args[])
to be necessarily present when running an application. The VM calls this particular method to run your program.
When you compile your code, the VM has no idea that you are going to run the application using this class. So it compiles assuming that the method
public static void main(){...}
is simply another method like
public static void someMethod(){ ... }
But then you hit an exception when you attempt to run it coz the method required to start it is not present.
That's a long ans.
Regds
Sathish