πŸ“Š JAVA
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};
πŸ’¬ Discuss
βœ… Correct Answer: (B) int[][] arr = new int[3][3];

Explanation: 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.

Explanation by: Deepak Sahoo
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.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
285
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Deepak Sahoo
Publisher
πŸ“ˆ
95%
Success Rate