JAVA之Map转JSONObject

private JSONObject toJsonObj(Map<String, Object> map, JSONObject resultJson) {
Iterator it = map.keySet().iterator();
while (it.hasNext()) {
String key = (String) it.next();
resultJson.put(key, map.get(key));
}
return resultJson;
}

转载于:https://www.cnblogs.com/hjy1017/p/6755798.html