java - Why key in HashMap can't be duplicated -
i know how hash map works. can't use duplicate keys in hashmap. want know logic behind used sun people. how has been coded can't store duplicate key in hashmap.
it's part of contract of map interface:
an object maps keys values. map cannot contain duplicate keys; each key can map @ 1 value.
what should map.get(key)
return if key has multiple values?
Comments
Post a Comment