Thursday, 8 August 2013

Assign value to an element of 2-D array

Assign value to an element of 2-D array

I tried to create a 2-D array and initialize an element. Here is my code.
class Test{
int[][] matrix = new int[3][3];
matrix [1][1] = 2;
}
But, I am getting errors. I do not know where I am wrong.

No comments:

Post a Comment