print key value of hashmap in java code example
Example 1: print elements in map java
// Java 8 - Collection.iterator() + Iterator.forEachRemaining()
map.keySet().iterator()
.forEachRemaining(System.out::println);
Example 2: print only values in map
map.forEach((key, value) -> System.out.println(key + " " + value));