// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class TwoDimArrays {
    public static void main(String[] args) {
        int[][] a1 = new int[3][3];
        for(int i = 0; i < a1.length; i++) {
            for(int j = 0; j < a1[i].length; j++) {
                System.out.print(" " + a1[i][j]);
            }
            System.out.println();
        }
        int[][] a2 = new int[3][];
        a2[0] = new int[1];
        a2[1] = new int[2];
        a2[2] = new int[3];
        for(int i = 0; i < a2.length; i++) {
            for(int j = 0; j < a2[i].length; j++) {
                System.out.print(" " + a2[i][j]);
            }
            System.out.println();
        }
    }
}
