2020
10-10
10-10
java8 forEach结合Lambda表达式遍历 List操作
我就废话不多说了,大家还是直接看代码吧~@TestvoidtestJava8ForeachMap(){Map<String,Integer>items=newHashMap<>();items.put("A",10);items.put("B",20);items.put("C",30);items.put("D",40);items.put("E",50);items.put("F",60);//普通方式遍历Mapfor(Map.Entry<String,Integer>entry:items.entrySet()){System.out.println(entry.getKey()+":"+entry.getValue());}System.out.println("===...
继续阅读 >