Multiple Choice Question

Quiz Guidelines

 

QID: 
512
Tags: 
Question: 

Consider the following class :

public class Test{
public static void main(String[] args){
if (args[0].equals("open"))
if (args[1].equals("someone"))
System.out.println("Hello!");
else System.out.println("Go away "+ args[1]);
}
}

Which of the following statements are true if the above program is run with the command line : java Test closed

Select 1 option

A. It will throw ArrayIndexOutOfBoundsException at runtime.
B. It will end without exceptions and will print nothing.
C. It will print Go away
D. It will print Go away and then will throw ArrayIndexOutOfBoundsException.
E. None of the above.

Q&A Set: