Hi kiranv
---------------------------------
You wrote
herbert,
I did not get your point..
I dont think the code below works
public class test{
int[][] c;
c = new int[][]{{1,2},{3,4}};
}
Herbert doesn't say that this will work. The initilization
code c = new int [][]{{1,2},{3,4}}; has to be inside a method or
inside a initializer code block.
So
public class test{
int[][] c;
{
c = new int[][]{{1,2},{3,4}};
}
}
Will work
I have the below code working:
public class test{
public static void main(String args[]){
int[][] c;
c = new int[][]{{1,2},{3,4}};
}
}
or we could do this:
public class test{
static int[][] c;
public static void main(String args[]){
c = new int[][]{{1,2},{3,4}};
}
}
Both the above cases had the code inside the main method. So these two should work. Did I get it correctly?
thnks
--------------------------------
I did some comments to your question. Hope this helps.
Thanks
ARS Kumar.