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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

1111. appearing after print sequence - php -