java - Looping into 2d Object array -
object [][] data = new object[4][4] ;
(int =0;i<data.length;i++) { data[i]={"a","b","c","d"}; }
is there way fill 2 day array way similar that, note: ,b,c , d different data can't use 2 loops fill array 'm searching close way
when tried
data[i]={"a","b","c","d"};
i thought going work reason didn't
you need use "new" or give indexes
something this:
data[i]= new object[]{"a","b","c","d"};
or
data[i][0] = "a"; data[i][1] = "b"; data[i][2] = "c"; data[i][3] = "d";
Comments
Post a Comment