请知悉:本文最近一次更新为 4年 前,文中内容可能已经过时。

Java 遍历Map网上的示例很多,这里只给两个,自行参悟。

Map<String, String> params = new HashMap<>();
Map<String, String> customInfo = new HashMap<>();
customInfo.put("a", "1");
customInfo.put("b", "1");
customInfo.put("c", "1");
for (Map.Entry<String, String> entry : customInfo.entrySet()) {
System.out.println(entry.getKey() + ":" + entry.getValue());
}
params.put("d", "4");
params.put("e", JsonUitls.toJson(customInfo));
for (String paramName : params.keySet()) {
System.out.println(aramName+":"+params.get(paramName));
}

如您从本文得到了有价值的信息或帮助,请考虑扫描文末二维码捐赠和鼓励。

尊重他人劳动成果。转载请务必附上原文链接,我将感激不尽。


与《Java 遍历Map示例》相关的博文:


留言

Admin Avatar
😀
😀😁😂😅😭🤭😋😘🤔😰😱🤪💪👍👎🤝🌹👌