| Author |
adding objects to HashMap that have duplicate keys
|
Rachel Glenn
Ranch Hand
Joined: Oct 24, 2012
Posts: 95
|
|
If I have a HashMap, and I call .put() several times with the same key..for example..
Then the first put() call will return true and the second put() call will return false because the "Monday" key already exists?
|
 |
Jayesh A Lalwani
Bartender
Joined: Jan 17, 2008
Posts: 1272
|
|
|
put doesn't return a boolean. put returns the previous value. So, first call will return null and second call will return the first object
|
 |
 |
|
|
subject: adding objects to HashMap that have duplicate keys
|
|
|