笔记

json与hashmap的区别

HashMap hashMap = new HashMap();
hashMap.put("111","222");
hashMap.put("333","444");
hashMap.put("333","555");
System.out.println(hashMap);
JSONObject json = new JSONObject();
json.put("111","222");
json.put("333","444");
json.put("333","555");
System.out.println(json);

hashmap:{111=222, 333=555}
jsonObject:{"111":"222","333":"555"}

posted @ 2023-07-01 06:13  人在代码在  阅读(8)  评论(0)    收藏  举报