欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

java拼接JSON串

程序员文章站 2022-03-08 12:01:35
...
//java拼接JSON串
String str = "{\"route\":\"onGift\",\"time\":\"\",\"userId\":\"\",\"userName\":\"\",\"level\":\"1_2_2_2_0\",\"adminType\":0,\"tuserId\":\"\"," +
        "\"tuserName\":\"\",\"tlevel\":\"10_2_2_2_0\",\"roomId\":\"\",\"giftId\":\"001\",\"fcId\":\"0\",\"amount\":\"1\",\"price\":\"0\",\"bean\":\"6546316\"}";

JSONObject json = null;

try {
    json = new JSONObject(str);
} catch (JSONException e) {
    e.printStackTrace();
}


相关标签: java