Question 1 of 10
A rink board stores frost scores. The code finds the maximum of the whole rectangle. What text does this Java code display?
int[][] frost = {
{6, 2, 9},
{11, 4, 1}
};
int max = frost[0][0];
for (int r = 0; r < frost.length; r++) {
for (int c = 0; c < frost[0].length; c++) {
if (frost[r][c] > max) {
max = frost[r][c];
}
}
}
System.out.print(max);
- A. 9
- B. 11
- C. 6
- D. 4