求助:我弄的类是这样的:
public class Test3 {
public String name;
public List numbers;
public List arrays;
}
生成json:
private void xObjToJson() {
List numbers = new ArrayList<>();
numbers.add(10);
numbers.add(20);
List arrays = new ArrayList<>();
arrays.add(new int[]{10,11});
arrays.add(new int[]{12,13,15});
arrays.add(new int[]{99});
Test3 test3 = new Test3("哈哈",numbers,arrays);
String json = JSON.toJSONString(test3);
Log.i(TAG, "xObjToJson: " + " " + json);
//这个地方没出问题
}
生成的结果: {"arrays":[[10,11],[12,13,15],[99]],"name":"哈哈","numbers":[10,20]}
解析JSON不知道该怎么弄,用JSON.parseObject(json, Test3.class);出错