Question 1 of 10
A camp kitchen allocates stew-pot counts. What text does this Java code display?
int[][] pots = new int[3][2];
System.out.print(pots[2][1]);
- A. 3
- B. 2
- C. 0
- D. null
A camp kitchen allocates stew-pot counts. What text does this Java code display?
int[][] pots = new int[3][2];
System.out.print(pots[2][1]);
A cider press stores vat readings. What text does this Java code display?
int[][] vats = { {6, 1, 4}, {2, 9, 8} };
System.out.print(vats[0][2]);
A train yard creates a 5-by-2 cargo map. Which statement is true?
int[][] cargo = new int[5][2];
A museum display aliases the top shelf. What text does this Java code display?
int[][] crates = { {11, 12, 13}, {21, 22, 23} };
int[] top = crates[0];
System.out.print(top[1]);
A marsh survey allocates wet/dry flags. What text does this Java code display?
boolean[][] wet = new boolean[2][3];
System.out.print(wet[0][2]);
An observatory allocates filter names. What text does this Java code display?
String[][] filters = new String[3][1];
System.out.print(filters[2][0]);
A tide station allocates meter readings. What text does this Java code display?
double[][] meters = new double[1][3];
System.out.print(meters[0][2]);
A mini-golf card stores hole scores. What happens when this Java code runs?
int[][] card = { {9, 8}, {7, 6} };
System.out.print(card[0][2]);
A firefly lab overwrites one jar count. What text does this Java code display?
int[][] jars = { {1, 2}, {3, 4} };
jars[1][0] = 7;
System.out.print(jars[0][0] + "," + jars[1][0]);
A solar-garden planner stores panel watts. The table shows the contents of watts. Which access reads the 18?
| row | Column 0 | Column 1 | Column 2 |
|---|---|---|---|
| Row 0 | 11 | 18 | 7 |
| Row 1 | 4 | 22 | 9 |
| Row 2 | 15 | 3 | 6 |
int[][] watts = { {11, 18, 7}, {4, 22, 9}, {15, 3, 6} };