博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
json 遍历 jsonobject jsonarray
阅读量:6989 次
发布时间:2019-06-27

本文共 694 字,大约阅读时间需要 2 分钟。

 

 

 

 

 

public static void main(String[] args) {          String str = "{'TI':[{'value':'aa1','count':10},{'value':'aa2','count':15},{'value':'aa3','count':20}]," +                  "'AB':[{'value':'ab','count':110},{'value':'ab2','count':115},{'value':'ab3','count':210}]}";          JSONArray newArray = new JSONArray();          JSONObject newJson = new JSONObject();          try {              JSONObject obj = new JSONObject(str);              Iterator it = obj.keys();              while (it.hasNext()) {                  String key = (String) it.next();                  String value = obj.getString(key);                  JSONArray array = obj.getJSONArray(key);                  for(int i=0;i

 

转载地址:http://vszvl.baihongyu.com/

你可能感兴趣的文章
django之修改登录访问的内容
查看>>
性能测试培训:定位jvm耗时函数
查看>>
Linux 命令符下安装Oracle
查看>>
it翘楚-兄弟连兄弟会
查看>>
超棒的CSS开源UI界面元素类库 - TopCat
查看>>
javaExecutors并发线程池ThreadPoolExecuto
查看>>
坦克大战源码
查看>>
不限量的快递查询接口-JAVA对接方法
查看>>
jib自定义entrypoint
查看>>
掌握Beyond Compare比较表格技巧
查看>>
图书资源下载网站推荐
查看>>
fastjson 总结
查看>>
Python Split函数的用法总结(持续更新中。。。)
查看>>
决心书
查看>>
介绍遍历子表的方法
查看>>
网络的分类
查看>>
PGSQL创建自增的id-- postgresql nextval 使用
查看>>
12python程序另一种运行方式
查看>>
Tomcat高级应用(添加虚拟主机及优化)
查看>>
Kindeditor(jsp)与SSH三大框架整合上传图片出错问题解决方案
查看>>