for (Map.Entry<String,Integer> pair : myHashMap.entrySet()) { System.out.println(pair.getKey()); System.out.println(pair.getValue()); }