A

Admin • 802.91K Points
Coach

Q. Which of the following creates a jagged array in Java?

  • (A) int[][] arr = new int[2][2];
  • (B) int[][] arr = new int[2][];
  • (C) int[][] arr = {{1, 2}, {3, 4}};
  • (D) int[][] arr = new int[][];

Explanation by: Admin
Option B creates an array of 2 rows without specifying column size (jagged array).

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.