下列数组初始化语句哪些是正确的?(3分)
A: int[] nums = new int[]{0,1,2,3,4};
B: int[] nums2 = {0,1,2,3,4,5};
C: int[][] num_1 = {new int[]{0,1},new int[]{0,1,2},new int[]{0,1,2,3}};
D: int[][] num_2 = {{0,1},{0,1,2},{0,1,2,3}};
A: int[] nums = new int[]{0,1,2,3,4};
B: int[] nums2 = {0,1,2,3,4,5};
C: int[][] num_1 = {new int[]{0,1},new int[]{0,1,2},new int[]{0,1,2,3}};
D: int[][] num_2 = {{0,1},{0,1,2},{0,1,2,3}};
举一反三
- 以下对二维数组a初始化正确的语句是_。 A: int a[2][ ]={{0 , 1 , 2}, {3 , 4 , 5}}; B: int a[ ][3]={{0, 1, 2}, {3, 4, 5}}; C: int a[2][4]={{0, 1 , 2}, {3 , 4}, {5}} D: int a[ ][3]={{0, 1, 2}, { }, {3, 4}};
- 下列数组初始化语句哪些是正确的 A: int[] nums = new int[]{0,1,2,3,4}; B: int[] nums2 = {0,1,2,3,4,5}; C: int[][] num_1 = {new int[]{0,1},new int[]{0,1,2},new int[]{0,1,2,3}}; D: int[][] num_2 = {{0,1},{0,1,2},{0,1,2,3}};
- 下列数组初始化语句哪些是正确的 A: int[] nums = new int[]{0,1,2,3,4}; B: int[] nums2 = {0,1,2,3,4,5}; C: int[][] num_1 = {new int[]{0,1},new int[]{0,1,2},new int[]{0,1,2,3}}; D: int[][] num_2 = {{0,1},{0,1,2},{0,1,2,3}};
- 下列数组初始化语句哪些是正确的 A: int[] nums = new int[]{0,1,2,3,4}; B: int[] nums2 = {0,1,2,3,4,5}; C: int[][] num_1 = {new int[]{0,1},new int[]{0,1,2},new int[]{0,1,2,3}}; D: int[][] num_2 = {{0,1},{0,1,2},{0,1,2,3}};
- 下列数组初始化语句哪些是正确的?(3分) A: int[] nums = new int[]{0,1,2,3,4}; B: int[] nums2 = {0,1,2,3,4,5}; C: int[][] num_1 = {new int[]{0,1},new int[]{0,1,2},new int[]{0,1,2,3}}; D: int[][] num_2 = {{0,1},{0,1,2},{0,1,2,3}};