rewrite icon indicating copy to clipboard operation
rewrite copied to clipboard

prefer `map.entrySet()` over manual iteration of the `keySet` and manual access to the values

Open yeikel opened this issue 2 years ago • 0 comments


Map<String,String> map = new HashMap<>();
map.put("hello","world");

for (String key : map.keySet()){
String value = map.get(key);
System.out.println("Key " + key + " value " + value);
}


Map<String,String> map = new HashMap<>();
map.put("hello","world");

for (Map.Entry<String, String> entry : map.entrySet()){
System.out.println("Key " + entry.getKey() + " value " + entry.getValue());
}

yeikel avatar Apr 16 '22 20:04 yeikel