Would anyone please explain the output showm at the bottom for this code. I am somewhat confused about this part and understanding what is stored in doc after execution...
doc[a][b] = a + b;
public class doc
{
public static void main(String[] args)
{
int b = 0;
int [][] doc = new int [3][3];
int a;
while (b<3)
{
for(a=2; a >=0; a--)
doc[a][b] = a + b;
++b;
}
int j;
for (int i=0; i<doc.length; i++) {
for (j=0; j<doc[i].length; j++) {
System.out.println(" " + doc[i][j]); }
System.out.println("");
}
}
}
0
1
2
1
2
3
2
3
4
The output is above.
Thank you.