for (Map.Entry<String, String> entry : yourHashMap.entrySet()) { System.out.println(entry.getKey() + " = " + entry.getValue()); } map.forEach((k, v) -> { System.out.format("key: %s, value: %d%n", k, v); });