I am using HashMap and have found an example of using compact type of FOR
Map<String, Integer> hashMap = new HashMap<>();
hashMap.put("one", 5);
hashMap.put("two", 8);
hashMap.put("three", 12);
hashMap.put("four", 5);
Set<Map.Entry<String, Integer>> set = hashMap.entrySet();
for (Map.Entry<String, Integer> me : set) {
System.out.print(me.getKey() + ": ");
System.out.println(me.getValue());
}
And i cant find an answer how does people use short variant of writing cycle FOR and how do they generate parameters for that. I mean this line
for (Map.Entry<String, Integer> me : set)