Since its possibly one of the most widely used methods of the Java language, why does it have to accept an array of Strings and doesn\'t work without it? For example, I coul
I agree that it could be more flexible. In C# for instance, all of these are acceptable entry points:
static void Main()
static void Main(string[] args)
static int Main()
static int Main(string[] args)
The versions returning int
use the return value as the exit code for the process. If you don't care about receiving any arguments, you can use one of the versions which doesn't take any. Any arguments given when the program is launched are ignored.
So yes, it could be more flexible - but it's never struck me as a significant problem in Java.