通过迭代器来遍历HashMap,演示一下迭代器Iterator的使用 Map<Integer, String> map = new HashMap<>(); map.put(1, "java"); map.