import java.util.Arrays; class Array2D { public static void main (String arg[]) { int[][] sqr = new int[5][5]; // note: array elements are given default values, numbers get zero. System.out.println("Here is the sqr array:"); for (int r=0; r < sqr.length; r++) { System.out.println(Arrays.toString( sqr[r])); } int[][] tri; tri = new int[5][]; // note: only allocates number of columns, each row still needs to be defined. for (int r=0; r < tri.length; r++) { tri[r] = new int[r+1]; // Allocate each row with differing size } System.out.println("-------------------------------------"); System.out.println("Here is the tri array:"); for (int r=0; r= n-k+1) { result = result*a; while ((result%b==0) && (b<=k)) { result = result/ b; b++; } a--; } return result; } }