A

Admin • 828.03K Points
Coach

Q. Which of the following is a valid way to declare a multi-dimensional array in Java?

  • (A) int[] arr = new int[3][3];
  • (B) int[][] arr = new int[3][3];
  • (C) int[][] arr = new int[3,3];
  • (D) int[] arr = new int[]{3,3};
  • Correct Answer - Option(B)
  • Views: 15
  • Filed under category Java
  • Hashtags:

Explanation by: Admin
To declare a multi-dimensional array in Java, we use the syntax int[][] arr = new int[3][3], where 3 is the size of both the first and second dimension of the array.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.