Welcome to JavaRanch Munjal!
Yes, As Henry said, the JVM is picky. While the compiler dosen't care (to a degree of course) how you declare the main method, the JVM
always expects the main method to carry a
String array as an argument. The name of the array does not matter. For example, you will often find the main method decalred as
but you are welcome to name the array anything, as long as it agrees with the conventions for declaring an array. Another legal example:
or prehaps...
This was a subject that was confusing to me when I began programming. Basically the String array argument is there in case you want to pass something to the
java program from the command line.
I hope this was somewhat helpful
Tommy T.