score:1

Accepted answer

silly me... in order for the json to recognize it as an array field...

instead of doing this...

objlist.data[0] = 100;

i should've done it like this...

 objlist = new genlist();
 objlist.name = "test";
 objlist.data = new [] {100};
 objgenlist.add(objlist);

the output would be

{ name : "test1", data : [100]}

score:1

your method isn't returning anything, does adding this this work?

return objgenlist;


Related Query

More Query from same tag