Will someone tell me the error in my programming please? The output I get when I run the program below is: args.length = 0. I also get ArrayIndexOutOfBoundsException in argument two.
Shouldn't the output be ?
args.length = 3
arg.[0] = 1
arg.[1] = 2
arg.[2] = 3
Code:
public class CommandLine {
public static void main(String args[ ]) {
System.out.println("args.length = " + args.length);
System.out.println("args[0] = " + args[0]);
System.out.println("args[1] = " + args[1]);
System.out.println("args[2] = " + args[2]);
}
}
Shouldn't the output be ?
args.length = 3
arg.[0] = 1
arg.[1] = 2
arg.[2] = 3