JSON与null

Posted 小鸣的网络日志

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JSON与null相关的知识,希望对你有一定的参考价值。

org.json.JSONObject orgJSON = new org.json.JSONObject();
// The method put(String, Collection) is ambiguous for the type JSONObject
//orgJSON.put("null", null);
net.sf.json.JSONObject netJSON = new net.sf.json.JSONObject();
netJSON.put("null", null);

System.out.println("netJSON" + netJSON); // 控制台输出 : netJSON{}

以上是关于JSON与null的主要内容,如果未能解决你的问题,请参考以下文章