I'm new to Java programming and noticed that in my reading (learning) that there appear to be 2 acceptable syntax for the 'main' statement.
Example 1:
class MyClass{
public static void main(String args[]) {
// code goes here
}
}
Example 2:
class MyClass{
public static void main(String [] args) {
// code goes here
}
}
note the positon of the [] in the two examples.
Are both forms acceptable, or does it compile and run correctly only because I am not passing any arguments to the main routine?
Thanks in advance.