您当前的位置: 首页 >  Java

星夜孤帆

暂无认证

  • 3浏览

    0关注

    626博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

JAVA对象转换为JSON字符串

星夜孤帆 发布时间:2020-04-24 17:15:06 ,浏览量:3


    com.alibaba
    fastjson
            1.2.58
 

使用FastJson进行操作

public class TestJson implements Serializable{
    private String id;
    private String age;
}
public class Main{

    public static void main(String[] args){
        TestJson tj = new TestJson();
        String s = JSON.toJSONString(tj);
        System.out.println("toJsonString方法: " + s);
    }
}

https://blog.csdn.net/xuforeverlove/article/details/80842148?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-4&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-4

https://blog.csdn.net/jin2111843364/article/details/81016650

http://www.java2s.com/Code/Jar/j/Downloadjsonlib222jdk15jar.htm

关注
打赏
1636984416
查看更多评论
立即登录/注册

微信扫码登录

0.2020s