【发布时间】:2016-12-27 12:10:51
【问题描述】:
我需要像 ArrayList<List<String>>()
ArrayList<JSONObject>() 中的值
对于ArrayList<List<String>>我使用了以下代码
for(List<String> dreport : report) {
for(String ddreport: dreport) {
// CODE GOES HERE
}
}
在一个新的场景中,我需要使用该功能。但是该值包含在 ArrayList() 中,而不是字符串列表中
示例代码:
List<JSONObject> json = new ArrayList<JSONObject>();
JSONObject json_data1 = new JSONObject();
json_data1.put("count", "value");
json_data1.put("count", "value");
json_data1.put("count", "value");
json.add(json_data1);
【问题讨论】:
-
否则,我可以将 ArrayList
() 转换为 ArrayList- >()
-
您使用的是哪个 json 依赖项?
json.org? -
发布您的示例 json 字符串