Check my program....i'm printing the values of 2-D array in a ladder form.
int [][] TwoDArray;
TwoDArray = new int [4][];
TwoDArray [0] = new int [1];
TwoDArray [1] = new int [2];
TwoDArray [2] = new int [3];
TwoDArray [3] = new int [4];
This is working perfectly fine but when i'm reversing the values of array the program is not working.
TwoDArray = new int [4][];
TwoDArray [0] = new int [4];
TwoDArray [1] = new int [3];
TwoDArray [2] = new int [2];
TwoDArray [3] = new int [1];
Why this is happening ?
also when i am assigning value like this,
int [][] arrey;
arrey=new int [3][3] = {{1,2,3},{4,5,6},{7,8,9}};
The program is not working :(
How can i fix these problems.