java二给数组打印问题
publicclassTest5{publicstaticvoidmain(String[]s){int[][]a={{656,54,6234,56124,512,425...
public class Test5{
public static void main(String[] s){
int[][] a={
{656,54,6234,56124,512,425,251},
{524554,454,54,542,1212,2121,5},
{54521},
{547812,21,21,23,-122},
{1221,0,2512,15,41584,523,2}
};
for(int i=0;i<a.length;i++){
for(int k=0;k<a[i].length;k++){//请问这里的“k<a[i].length”是指的什么?
System.out.print(a[i][k]+" ");
}
System.out.println();
}
}
}
//请问大神这里的“k<a[i].length”是指的是什么?
a[i].length是不是该数组最后一行的长度? 展开
public static void main(String[] s){
int[][] a={
{656,54,6234,56124,512,425,251},
{524554,454,54,542,1212,2121,5},
{54521},
{547812,21,21,23,-122},
{1221,0,2512,15,41584,523,2}
};
for(int i=0;i<a.length;i++){
for(int k=0;k<a[i].length;k++){//请问这里的“k<a[i].length”是指的什么?
System.out.print(a[i][k]+" ");
}
System.out.println();
}
}
}
//请问大神这里的“k<a[i].length”是指的是什么?
a[i].length是不是该数组最后一行的长度? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询