I've been trying to figure out what exactly is happening here. I'm just trying to figure out what the 2 lines are doing that I've commented on below. I found this program that doesn't declare the full dimensions of the array (instead of new int[10][5]; it just decides to not declare it by saying 'new int[10][];' It's like the 2nd array length doesn't matter (changing it to 1 or 100 doesn't affect the output).
int[][] tri = new int[10][]; //this lack of giving the size of the 2nd array is strange
for (int r=0; r<tri.length; r++) {
tri[r] = new int[r+1]; //I'm not sure what this line is doing really
}
for (int r=0; r<tri.length; r++) {
for (int a=0; a<tri[r].length; a++) {
System.out.print(tri[r][a]);
}
System.out.println();
}