【发布时间】:2010-10-05 11:45:37
【问题描述】:
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
Map<String, Object> map = new HashMap<String, Object>();
map.put("abc", "123456");
map.put("def", "hmm");
list.add(map);
JSONObject json = new JSONObject(list);
try {
System.err.println(json.toString(2));
} catch (JSONException e) {
e.printStackTrace();
}
这段代码有什么问题?
输出是:
{"empty": false}
【问题讨论】: