2021
02-21
02-21
Java 如何解析key为动态的json操作
遇到了这样的json串:"panel":{"8":{"112":1},"11":{"147":2}}遍历获取Key和ValueLinkedHashMap<String,String>jsonMap=JSON.parseObject(jsonStr,newTypeReference<LinkedHashMap<String,String>>(){});for(Map.Entry<String,String>entry:jsonMap.entrySet()){System.out.println(entry.getKey()+":"+entry.getValue());}补充:Java利用反射动态获取参数并进行操作实例,...
继续阅读 >