java - why does return type of values in iterator not a set? -
in map interface
collection<v> values();
why function not return set entryset()
, keyset()
?
thanks.
in map, keys unique can map same value.
put way:
the values not unique , therefore cannot stored in set without losing duplicates.
the keys , entires, on other hand, unique.
Comments
Post a Comment