1.

What will be the output of the program?

public class CommandArgsTwo { public static void main(String [] argh) { int x; x = argh.length; for (int y = 1; y <= x; y++) { System.out.print(" " + argh[y]); } }
}

and the command-line invocation is

> java CommandArgsTwo 1 2 3

A. 0 1 2
B. 1 2 3
C. 0 0 0
D. An exception is thrown at runtime
Answer» E.


Discussion

No Comment Found

Related MCQs