L
lonelyplanet999
Hi,
I have written a .java file with below source code.
public class getargs {
public static void main (String [] args) {
System.out.println(args.length);
}
}
Compilation succeeded. But when I ran the program with below
parameters:
java getargs abc
or
java getargs "abc"
the program returned 0 in both cases. If I don't intertpret wrongly,
args.length should contain the count of program arguments. Why would I
get the result as I ran this program ?
I run java SDK 1.4.1.
I have written a .java file with below source code.
public class getargs {
public static void main (String [] args) {
System.out.println(args.length);
}
}
Compilation succeeded. But when I ran the program with below
parameters:
java getargs abc
or
java getargs "abc"
the program returned 0 in both cases. If I don't intertpret wrongly,
args.length should contain the count of program arguments. Why would I
get the result as I ran this program ?
I run java SDK 1.4.1.