首页 > Web开发 > 详细

list转为json

时间:2017-09-30 22:33:27      阅读:296      评论:0      收藏:0      [点我收藏+]
public class List2Json {
    public static JSONArray ProLogList2Json(List<ProgramLog> list){
         JSONArray json = new JSONArray();
         for(ProgramLog pLog : list){
             JSONObject jo = new JSONObject();
             jo.put("id", pLog.getId());
             jo.put("time", pLog.getBeginTime());
              
             json.put(jo);
         }
         return json;
    }

list转为json

原文:http://www.cnblogs.com/weyine/p/7616255.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!