B is wrong. The correct answer is D (line 2). Run this code :
********************************************
public class Test018 {
public static void main(
String args[]) {
System.out.println("1");
int i[] = new int[0]; //1
System.out.println("2");
System.out.println(i[0]); //2
}
}
********************************************
Output is :
==============================================
1
2
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
at Test018.main(Test018.java:8)
==============================================
Jamal