user840930 user840930 - 7 months ago 42
Java Question

How can I retrieve values and keys from a HashMap in Java 8?

I tried to use an Iterator but gives me an int. Not sure what to do with an int. How can I get the keys and values?

for (final Map.Entry<String, Object> entry : hashmap.entrySet()) {
       final String key = entry.getKey();
       System.out.println("Key:" + key);
       Object obj = entry.getValue();