json put accumulate element 区别
来源:互联网 发布:下载office for mac 编辑:程序博客网 时间:2024/06/07 16:10
JSONObject jsonObject = new JSONObject(); jsonObject.put("1", "2"); jsonObject.put("1", "3"); System.out.println(jsonObject.toString());
此时打印结果为:{"1":"3"} put直接替换key指向的value
jsonObject.accumulate("1", "4"); System.out.println(jsonObject.toString());
打印结果 {"1":["3","4"]} accumulate 添加value不替换 到key
Object object = null; jsonObject.element("1", object); System.out.println(jsonObject.toString());
打印结果:{} element 如果value为空值 key也被移除
而如果是accumulate 方法 则会在value后面加一个null元素 {"1":["3","4",null]}
0 0
- json put accumulate element 区别
- JSON put ,accumulate,element 区别
- json put方法,accumulate方法,element方法
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject put accumulate element 步骤区别
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject:put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JsonObject put、element、accumulate的区别。
- JSONObject put,accumulate,element的区别
- JSONObject put,accumulate,element的区别
- JSONObject中put/element/accumulate区别
- JSONObject put,accumulate,element的区别 和 例子
- js对操作form提交
- iOS---------自定义slider
- velocity模板技术生成word文档
- PhoneGap开发的android项目环境搭建简单流程
- 15个nosql数据库
- json put accumulate element 区别
- C++this指针(二)
- 怎样添加java的log4j添加到java项目中
- [LeetCode] Valid Palindrome [10]
- 个人必备的小插件
- 设置mysql允许外部IP访问
- ProgressDialog(一)——常用ProgressDialog设置
- Oracle11g导出dmp空表不能导出解决办法
- 查找MobileSafari WebKit revision number的方法