Hi All,
I found one question Arrays. It goes like this :
Which of these statements are legal. Select the three correct answers.
A. int arr[][] = new int[5][5];
B. int[]arr[] = new int[5][5];
C. int[] arr = new int[5][];
D. int[] arr = new int[][5];
ANS : A, B, c
I think 'C' is incorrect way of declaring array. Can anyone confirm me that? I tried compiling it and gave me a compilation error on jdk 1.6 . Is it a valid way on jdk 1.4 and prior versions?
Link to the question
http://www.simulationexams.com/SampleQuestions/java-certification/scjp/scjp_q1.htm Thanks in advance.
- Vivian