for loop get hashmap values code example
Example 1: java iterate through map
for (Map.Entry<String, Object> entry : map.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
// ...
}
Example 2: java loop hashmap
map.forEach((k, v) -> {
System.out.format("key: %s, value: %d%n", k, v);
});