第八章
8.1:int[] array = new int[4][5];
8.2: 二维数组的行可以有不同的长度。
8.3:输出结果为:array[0][1] is 2
8.4:
int[][] r = new int[2]; 语句不合法
int[] x = new int[]; 语句不合法
int[][] y = new int[3][]; 语句合法
int[][] z = {{1, 2}}; 语句合法
int[][] m = {{1, 2},{2, 3}}; 语句合法
int[][] n = {{1, 2},{2, 3}, }; 语句不合法
8.5:输出结果为:
6 5
4 3
2 1
8.6:输出结果为:9
8.7:输出结果为:
2
4
8.8:int [][][] m = new int [4][6][5];
8.9:总共120个元素在数组里;x.length is 12; x[2].length is 5; x[0][0].length is 2。
8.9:输出结果为:
1
8