public class Ragged2Darray { public static void main (String[] args) { int[][] table; // Initialize the array table = new int[5][]; for (int row=0; row < table.length; row++) table[row]= new int[row+1]; // fill the array with values for (int row=0; row < table.length; row++) for (int col=0; col < table[row].length; col++) table[row][col] = row*10 +col; // print the array for (int row=0; row < table.length; row++) { for (int col=0; col < table[row].length; col++) System.out.printf("%2d, ", table[row][col]); System.out.println(); } } }