int[][] m = {{1, 2, 3}, {4, 5, 6}};
int[] row = m[0];
row[1] = 99;
System.out.println(m[0][1]);What is printed?
- Acheck_circle
99
- B
2
- C
5
- D
0
Explanation
row is a reference to m[0]. Modifying row[1] modifies m[0][1], so it prints 99.
AP Computer Science A· difficulty 4/5
int[][] m = {{1, 2, 3}, {4, 5, 6}};
int[] row = m[0];
row[1] = 99;
System.out.println(m[0][1]);What is printed?
99
2
5
0
Explanation
row is a reference to m[0]. Modifying row[1] modifies m[0][1], so it prints 99.
Want 10 more like this — adaptive to your weak spots?