int[][] m = {{1, 2, 3}, {4, 5, 6}};
System.out.println(m[2][1]);What is the result?
- A
3
- B
5
- Ccheck_circle
ArrayIndexOutOfBoundsException
- D
6
Explanation
The array has 2 rows (indices 0, 1). Accessing m[2] throws ArrayIndexOutOfBoundsException.
AP Computer Science A· difficulty 4/5
int[][] m = {{1, 2, 3}, {4, 5, 6}};
System.out.println(m[2][1]);What is the result?
3
5
ArrayIndexOutOfBoundsException
6
Explanation
The array has 2 rows (indices 0, 1). Accessing m[2] throws ArrayIndexOutOfBoundsException.
Want 10 more like this — adaptive to your weak spots?