I was under the impression that the main method had to have the form \"public static void main (String[] args){}\", that you couldn\'t pass int[] arguments.
However,
Well, you can have any method with the name main
with any number of arguments. But the JVM will look for the main
method with the exact signature public static void main(String[])
.
The main
method you have defined is just another method to the class.
I don't have access to Windows now, but let me try it in a while. I did try on Fedora and of course I got the following exception:
Exception in thread "main" java.lang.NoSuchMethodError: main
Note that the class would compile fine because of the above said reason.
Update: I tested on Windows 7 and the results are same. I'm surprised how you said it worked for you.