int[][] m = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};
int rows = m.length;
int cols = m[0].length;
System.out.println(rows + "," + cols);What is printed?
- A
3,3
- B
12,0
- Ccheck_circle
3,4
- D
4,3
Explanation
There are 3 rows and 4 columns.
AP Computer Science A· difficulty 3/5
int[][] m = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};
int rows = m.length;
int cols = m[0].length;
System.out.println(rows + "," + cols);What is printed?
3,3
12,0
3,4
4,3
Explanation
There are 3 rows and 4 columns.
Want 10 more like this — adaptive to your weak spots?