yanish,
I agree with you that it compiles fine. But
it will not run fine unless you have an other
main method with a lowercase 'm'. If you attempt running a class with the main method described by you, you will get NoSuchMethodError.
The main method which is the starting point of execution of a class file has the signature
public static void main(String args[]) . If you attempt to run a program using java.exe, and if the JVM cannot find the main method with this signature , you will get
java.lang.NoSuchMethodError:main.
Since
Java is case sensitive, any other version of the main method can exist in a class. Note that main(), Main(), mAin(), mAIn() are all different methods. The important thing to remember here is, if you want your class to be executed by JVM, you better have a required main method.
If you have ever experimented witht the main method, the public modifer is actually not required for a program to run. ie., main methods with private or default modifiers works as well. However, for the sake of the exam, there is only one acceptable signature of the main method.
Hope this helps,
Ajith