jsonString转换为list:
JSONArray jsonArray=JSONArray.fromObject(result);
List<RentCar> books=(List)JSONArray.toList(jsonArray, Class);
list转换为jsonString
Gson gson=new Gson();
bookString = gson.toJson(list);
标签:tca obj res pos ons nbsp sonar body str
jsonString转换为list:
JSONArray jsonArray=JSONArray.fromObject(result);
List<RentCar> books=(List)JSONArray.toList(jsonArray, Class);
list转换为jsonString
Gson gson=new Gson();
bookString = gson.toJson(list);
标签:tca obj res pos ons nbsp sonar body str
原文地址:https://www.cnblogs.com/itjunjun/p/8360905.html