// 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 TwoDim {
    public static void print(int[][] a) {
        for(int i = 0; i < a.length; i++) {
            for(int j = 0; j < a[i].length; j++) {
                System.out.print(" " + a[i][j]);
            }
            System.out.println();
        }
    }
    public static void main(String[] args) {
        int[][] a1 = new int[3][];
        a1[0] = new int[1];
        a1[1] = new int[2];
        a1[2] = new int[3];
        print(a1);
        int[][] a2 = new int[3][4];
        print(a2);
    }
}
