About Question enthuware.ocpjp.v7.2.1293 :
Posted: Sat Sep 28, 2013 10:57 am
Hi,
"Only Map has values() method. This method returns a Set of values stored in the Map.".
This is not correct. values() returns a Collection of values, presumably because values can be duplicated in a Map (hence the need for a Collection of values), whereas keys cannot. Hence keySet and entrySet return a Set of keys and entries respectively.
Cheers
"Only Map has values() method. This method returns a Set of values stored in the Map.".
This is not correct. values() returns a Collection of values, presumably because values can be duplicated in a Map (hence the need for a Collection of values), whereas keys cannot. Hence keySet and entrySet return a Set of keys and entries respectively.
Cheers