- package hm;
- public class BigFor {
- public static void main(String[] args) {
- int[][] arr=new int[3][4];
- arr[0]=new int[]{1,2,3,4};
- arr[1]=new int[]{5,6,7,8};
- arr[2]=new int[]{9,10,11,12};
-
- for(int[] a : arr)//a是一维数组
- {
- for(int i : a )
- {
- System.out.print(i+" ");
- }
- }
- }
- }
复制代码 |