JSON

来源:互联网 发布:椰子油 炒菜 知乎 编辑:程序博客网 时间:2024/06/05 19:54

public class TestJson {
public static void main(String[] args){
JSONObject j = new JSONObject();
j.put(“key1”, “value1”);
j.put(“key2”, “value2”);
System.out.println(j);

    JSONObject k = JSONObject.parseObject(j.toString());    System.out.println(k.toJSONString());}

}