Loop Through a Hashmap for (String i : capitalCities.keySet()) { System.out.println(i); } for (String i : capitalCities.values()) { System.out.println(i); }