标签:++ package 初始化 java ted Stub style oid 执行
package jkcs; public class jblx { public static void main(String[] args) { // TODO Auto-generated method stub // TODO Auto-generated method stub int a[][] = new int[][]{{1},{2,3},{4,5,6}}; //初始化一个数组 System.out.println("-------------------"); System.out.println(a.length); //3 System.out.println("-------------------"); System.out.println(a[0].length); //1 System.out.println(a[1].length); //2 System.out.println(a[2].length); //3 System.out.println("-------------------"); System.out.println(a[0][0]); System.out.println(a[1][0]); System.out.println(a[1][1]); System.out.println(a[2][0]); System.out.println(a[2][1]); System.out.println(a[2][2]); System.out.println("-------------------"); for ( int k = 0;k<a.length;k++ ) { for( int j=0;j<a[k].length;j++ ) { System.out.print(a[k][j]+"--------"); } } } }
执行结果:
-------------------
3
-------------------
1
2
3
-------------------
1
2
3
4
5
6
-------------------
1--------2--------3--------4--------5--------6--------
标签:++ package 初始化 java ted Stub style oid 执行
原文地址:https://www.cnblogs.com/xiaobaibailongma/p/12866023.html