map的遍历
发布日期:2021-06-29 01:16:31 浏览次数:2 分类:技术文章

本文共 465 字,大约阅读时间需要 1 分钟。

最近刚刚用到了map的遍历,由于有一点忘了所以在使用完之后在此记下来以便以后使用。

代码如下

Map map=new HashMap
(); map.put(1, "nihasdasao"); map.put(2, "nihsdasdao"); map.put(3, "nisdadshao"); map.put(4, "nihadso"); Iterator it=map.entrySet().iterator(); while(it.hasNext()) { Entry e=(Entry) it.next(); System.out.println(e.getKey()); System.out.println(e.getValue()); }

在下只是一只刚成为程序员的小菜鸟,以上如有不对希望各位大神果断指出来!!!!

转载地址:https://blog.csdn.net/ys3198/article/details/53168550 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:对象类型的判断
下一篇:SpringMvc的点点滴滴之springMvc的配置

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年04月24日 10时21分07秒