Question 1
What is the printout of the following code?
public class Test {
public static void main(String[] args) {
| int[][][] data = {{{1, 2}, {3, 4}}, |
| System.out.print(data[1][0][0]); |
}
}
◦ 1
◦ 2
◦ 4
◦ 5
◦ 6
Question 2
What is the printout of the following code?
public class Test {
public static void main(String[] args) {
| int[][][] data = {{{1, 2}, {3, 4}}, |
| System.out.print(ttt(data[0])); |
}
public static int ttt(int[][] m) {
| for (int i = 0; i < m.length; i++) |
| for (int j = 0; j < m[i].length; j++) |
}
}
◦ 2
◦ 4
◦ 1
◦ 6
◦ 5