Consider the following code. int[][] matrix = new int[6][4]; Suppose we want to initialize the matrix to the following rows and columns. 3 2 1 0 0 1 2 3 3 2 1 0 0 1 2 3 3 2 1 0 0 1 2 3 Which of the options below correctly initializes the matrix? I. for (int i = 0; i < matrix.length - 1; i += 2) { for (int j = 0; j < matrix[i].length; j++) { matrix[i][j] = j; matrix[i + 1][j] = j; } } II. for (int i = 0; i < matrix.length - 1; i += 2) { for (int j = 0; j < matrix[i].length; j++) { matrix[i + 1][j] = j; matrix[i][matrix[i].length - j - 1] = j; } } III. for (int i = 0; i < matrix.length - 1; i += 2) { for (int j = 0; j < matrix[i].length; j++) { matrix[i + 1][j] = j; matrix[i][matrix[i].length - j - 1] = i; } }单项选择题

登录即可查看完整答案

我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。

类似问题

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!