Java OCA OCP Practice Question 1287

Question

What is the output of the following program when it is invoked using the command line:

java Test this is a test
class Test {
   public static void main(String[] args) {
      System.out.println(args[1]);
   }

}
  • A. this
  • B. is
  • C. a
  • D. test


B.

Note

The String "is" is assigned to args[1].




PreviousNext

Related