OCA Java SE 8 Mock Exam 2 - OCA Mock Question 20








Question

What will be printed out if the following code is run with the java Main hello world command?

        public class Main{ 
            public static void main(String argv[]) { 
               System.out.println(argv[1]); 
            } 
        } 
  1. world
  2. hello
  3. hello world
  4. ArrayIndexOutOfBoundsException is thrown




Answer



a

Note

The second command line argument is displayed.