OCA Java SE 8 Mock Exam 2 - OCA Mock Question 13
Question
Which of the following declares an array that supports two rows and a
variable number of columns?
- int myArray[][] = new int[2][3];
- int myArray[][] = new int[2][];
- int myArray[][] = new int[][];
- int myArray[][] = new int[][3];
Answer
Note
At least the first dimension of a multidimensional array must
be specified.