Which of the following is a valid declaration of a two-dimensional array in Java?
A. int[][] arr = new int[3][3];
B. int[][] arr = { {1, 2}, {3, 4}, {5, 6} };
C. int[] arr = {1, 2, 3};
D. All of the above.
Answer:A
Which of the following is a valid declaration of a two-dimensional array in Java?
A. int[][] arr = new int[3][3]; B. int[][] arr = { {1, 2}, {3, 4}, {5, 6} }; C. int[] arr = {1, 2, 3}; D. All of the above.