美文网首页
List集合转json

List集合转json

作者: 啤酒小龙虾 | 来源:发表于2018-07-10 17:07 被阅读0次

List<String> news = new ArrayList<>();

news.add("a");

news.add("b");

news.add("c");

JSONArray newsJson = JSONArray.fromObject(news);

String nStr = newsJson.toString();

JSONArray  需要导入 net.sf.json.JSONArray 包

有需要的下载jar包的请去我网盘链接下载

https://pan.baidu.com/s/1G1vvti0VQlf6bkNVkXM02w

相关文章

网友评论

      本文标题:List集合转json

      本文链接:https://www.haomeiwen.com/subject/zpkqpftx.html