hi, this is a simple program but i have no idea what the args.length
is for.
class PrintArgs {
public static void main (String[] args) {
for (int i = 0; i < args.length; i++) {
System.out.println(args[i]);
}
}
}
i added a few more lines(below) to the code to try to make sense of it but i keep getting "There are 0(zero) command line arguments"
here's the modified version
class PrintArgs
{
public static void main (String[] args)
{
for (int i = 0; i < args.length; i++)
{
System.out.println(args[i]);
}
System.out.print("There are ");
System.out.print(args.length);
System.out.print(" command line arguments");
System.out.println();
}
}
Thanks