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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -