Is there a difference between String[] args and String[] arg?
My assignment is to misspell certain things in a HelloWorld program.
When I misspelled args as arg in:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
The program compiled and ran correctly. So I'm trying to understand why arg worked just as well as args.
Is arg just an alternate spelling for args, or is there a difference between the two?
EDIT: I just tried misspelling args as ars, and the program compiled and ran correctly again. I'm definitely confused now.
marounas well (very recommended).main's parameter to be of typeString[].argsis nothing more than a standard.