Which of the following are legal array declarations.
-
int i[5][];
-
int i[][];
-
int []i[];
-
int i[5][5];
-
int[][] a;
B,C,E
Correct answer
Explanation
Java allows blank dimensions on the left side of array declarations. int[][] a, int []i[], and int i[][] are valid (declaring array type). However, int i[5][] or int i[5][5] are invalid because dimensions cannot be specified in declaration - only during initialization.