// Using entrySet() to get the entry's of the map
// m is previously created Map.
Set<Map.Entry<String,Integer>> s = m.entrySet();
for (Map.Entry<String, Integer> it: s)
{
String str = it.getKey();
}
Map.Enty is just the interface.
An interface doesn't have the implementation of the method getKey();
why the code above works? Like how the compiler knows the behavior of getKey()
?