概念:一维数组中的一维数组;数组中的元素,还是数组;
pubilc class Test{
pubilc static void main(String[] args){
int[][] nums = new int[3][5];
nums[0][0] = 10;//第一行。第一列
nums[0][3] = 10;//第一行,第四列
nums[1][1] = 10;
nums[1][2] = 10;
nums[2][4] = 10;
for(int i = 0 ; i <nums.length; i++){//外层控制行数
for(int j = 0; j <nums[i].length;j++){//内层控制列数
System.out.print(nums[i][j])
}
}
}
}


pubilc class Test{
pubilc static void main(String[] args){
int[][] array= new int[3][];//只有高维空间,没有低维空间
array[o] = new int[3];
array[o] = new int[5];
array[o] = new int[7];
}
}
右侧赞助一下 代码改变世界一块二块也是爱
浙公网安备 33010602011771号