濤。

t.

Cannot resolve method 'keys' in 'JSONObject'

//""自定义
String str = "";
JSONObject object = JSONObject.fromObject(str);
Map<String, Object> conditionMap = new HashMap<String, Object>();
Iterator<String> iterator = object.keys();
while (iterator.hasNext()){
String key = (String) iterator.next();
String val = object.getString(key);
System.out.println("[key="+key+"--> val="+val+"]");
conditionMap.put(key, val);
}
Iterator<String> iterator = object.keySet().iterator(); 
替换 
Iterator<String> iterator = object.keys();

 

posted on 2023-04-27 16:42  濤。  阅读(357)  评论(0编辑  收藏  举报

导航