Hi, Here is a question from Master Exam.
Quesion : What is the result ?
public class
Test {
public static void main(
String[] args)
{
long [][] a1 ;
long []a2[];
a2 = new long[3][];
a1 = a2 ; // mark 1
System.out.println(a1[1][0]);
}
}
The answer says compilation error on line mark 1. But I am able to compile it and getting runtime exception as expected. Is there anything I am missing or the answer provided is incorrect?
Thanks in advance,
Prasad