Then i will use a method to do it. Thank you.
Type: Posts; User: tommyabc
Then i will use a method to do it. Thank you.
But I need to initiallise matrix[0][0]=5, matrix[0][1]=5 ... matrix[200][200] = 5 in a class which does not have main class. May i know that if there are any ways i can do it other than using a...
Do you mean that I can only set all the matrix[][] locations equal to 5 with a method?
Because I want to do the following thing but it seems so stupid.
static int[][] matrix = {{5 /* x200...
Sorry, are there any misunderstanding? I mean that loop can only be placed inside a method. Outside a method, there is an error. So what i should do if I want to declare
matrix[0][0] = 5,...
I made a careless mistake here.
My code is fine now but I want to ask how i can set matrix[0][0]=5, matrix[0][1]=5 ... matrix[200][200] = 5
by using loop? A loop can only be performed inside a...
I want to set matrix[0][0]=5, matrix[0][1]=5 ... matrix[200][200] = 5
I want to use for loop to do so but it needs to work in a method.
Outside a method, I can't use for loop so i need to write a...
Class SetZero{
int x,y;
int[][] matrix = new int[200][200];
void setMartixZero(){
for(x=1 ; x<=200; x++)
for(y=1; y<=200; y++)
matrix[x][y] =...