The only clear commands of the main class for me are static
, because you have to execute the method wihtout needing an object, void
, because it has no return value and the String array name
which you can decide by your own. But what I don't understand is why the access has to be public
, why you can't decide the "main" name
and why the parameter has to be a String array
?
Are there other ways to create a method which is runnable like the casual main method
?
This is not possible:
...
public static void mayne(Object zzz) {
...
}
...
We do not pass any arguments to the main methods parameter(s)
, why is a String array
necessary?