Java 遍历Map常见的五种方法
Map<Integer,Integer> map=new HashMap<>(){"2":3};
Iterator<Map.Entry<Integer, Integer>> iterator = map.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry<Integer, Integer> next = iterator.next();
System.out.println("key:"+next.getKey()+" value:"+ next.getValue());
}