ForLoop.java 570 Bytes
Newer Older
Joel Florentin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
class ForLoop{
    public static void main(String[] args) {
        int twoD[][] = new int[4][5];
        int i, j, k = 0;
        for(i=0;i<4;i++){
            for(j=0;j<5;j++){
                twoD[i][j] = k;
                k++;
            }
        }
        for(i=0;i<4;i++){
            for(j=0;j<5;j++){
                System.out.print(twoD[i][j] + "\t");               
            }
            System.out.println();
        }
        if(i>0){
            int z = 0;
        }
        aux();
        h=5;
    }

    static void aux(){
        int h=3;
    }
}