views:

67

answers:

2

Question is simple for an expert

Integer[][] res= new Integer[][] {.....hard code some values here on 2 dim...}

How to return here 2 rows and 3 cols like this

1 2 3
4 5 6
+4  A: 
int[][] res = {{1,2,3},
               {4,5,6}};
Yuval A
Good but didn't the question want a Integer rather than an int? There is a subtle difference....
mikera
@mikera - I'm pretty sure OP can handle it from here...
Yuval A
+2  A: 

This should work. (But I am no java expert).

Integer [][] ints = { {1, 2, 3}, {4, 5, 6} };
nc3b