public static void main(String[] args) {
write your code here
int[][] A=new int[][]{{1,2},{4,5},{7,8,10,11,12},{}};
System.out.println(A.length);//4,表示数组的行数
System.out.println(A[0].length);//2,表示对应行的长度
System.out.println(A[1].length);//2
System.out.println(A[2].length);//5
}
————————————————
版权声明:本文为CSDN博主「二十六画生的博客」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u010002184/article/details/77103178
java二维数组
最新推荐文章于 2023-04-24 10:21:50 发布