hello, I came across this prob in Dans compresive test, the que was Entries are organized as key/value pairs. Duplicate entries replace old entries. Which interface of the java.util package offers the specified behavior? potions provided were a. List b. Map c. Set d. None of the above correct ans is b now nowhere in the API i came across - Duplicate entries replace old entries. Does this mean is that - there is an entry A which maps to DOS a new entry A which maps to UNIX replaces the dos entry. So i feel that d should be the correct option. If 'am wrong pls correct me. Wating for a quick response.
Originally posted by varijasmom: now nowhere in the API i came across - Duplicate entries replace old entries.
From the MAP API:
put public Object put(Object key, Object value) Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for this key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.))