赞助

概念:一维数组中的一维数组;数组中的元素,还是数组;

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];
  }
 }

  

 

posted on 2022-05-03 12:57  Tsunami黄嵩粟  阅读(22)  评论(0)    收藏  举报