Map<String,Integer> map = new HashMap<>(); map.put("one",1); map.put("two",1); map.put("three",1); map.put("four",1); map.put("five",1); for(Map.Entry<String,Integer> me:map.entrySet()){ System.out.println(me.getKey() + " --> " + me.getValue()) ; }
Map Foreach 输出
最新推荐文章于 2025-04-26 14:06:43 发布