What Happens If We Put A Key Object In A Hashmap Which Exists #675
What happens if we put a key object in a HashMap which exists?
This multiple choice question (MCQ) is related to the book/course gs gs128 Java. It can also be found in gs gs128 Java Util Collections Framework - Java HashMap - Quiz No.1.
What happens if we put a key object in a HashMap which exists?
The new object replaces the older object
The new object is discarded
The old object is removed from the map
It throws an exception as the key already exists in the map