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?

  1. int myArray[][] = new int[2][3];
  2. int myArray[][] = new int[2][];
  3. int myArray[][] = new int[][];
  4. int myArray[][] = new int[][3];




Answer



B

Note

At least the first dimension of a multidimensional array must be specified.