Page 1 of 1

What happens if we put a key object in a HashMap which exists?

Posted: Wed Jul 13, 2022 7:46 pm
by answerhappygod
a) The new object replaces the older object
b) The new object is discarded
c) The old object is removed from the map
d) It throws an exception as the key already exists in the map