Multiple Choice Question

Quiz Guidelines

 

QID: 
128
Question: 

What will the following code print when run without any arguments ...

public class TestClass {
public static int m1(int i){
return ++i;
}
public static void main(String[] args) {
int k = m1(args.length);
k += 3 + ++k;
System.out.println(k);
}
}

Select 1 option

A. It will throw ArrayIndexOutofBoundsException.
B. It will throw NullPointerException.
C. 6
D. 5
E. 7
F. 2
G. None of these.

Q&A Set: