Multiple choice technology programming languages

Which of the following are legal array declarations.

  1. int i[5][];

  2. int i[][];

  3. int []i[];

  4. int i[5][5];

  5. int[][] a;

Reveal answer Fill a bubble to check yourself
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.