首页 > 代码库 > 2 dimension Array; Table

2 dimension Array; Table

 1 package com.java7; 2  3 class TwoD { 4     public static void main(String[] args) { 5         int t, i; 6         int table[][] = new int[3][4]; 7          8         for(t = 0; t < 3; ++t){ 9             for(i = 0; i < 4; ++i){10                 table[t][i] = (t*4)+i+1;11                 System.out.print(table[t][i] + " ");12             }13             System.out.println();14         }15     }16 }

 

2 dimension Array; Table