Which syntax is incorrect to initialize a two-dimensional array in Java?

PYQ RPSC Programmer 2024

Which syntax is incorrect to initialize a two-dimensional array in Java?

  1. A.

    int myarr[][] = new int[3][4];

  2. B.

    int[][] myarr = {{1, 2, 3}, {4, 5, 6}};

  3. C.

    int[][] myarr = new int[3][4];

  4. D.

    int myarr = new int[3][4];

  5. E.

    Question not attempted

Attempted by 338 students.

Sign up free to check your answer

Sign up free

Explore the full course: Rpsc Programmer

Loading lesson…