https://blog.csdn.net/xiaofei__/article/details/89571320

 

(1)List转换为JSONArray

List<T> list = new ArrayList<T>();
JSONArray array= JSONArray.parseArray(JSON.toJSONString(list));

 


(2)JSONArray转换为List

JSONArray array = new JSONArray();
List<EventColAttr> list = JSONObject.parseArray(array.toJSONString(), EventColAttr.class); 

相关文章: