Vidyalelo
Java Programming · Q98

Java Collections Framework

Programming · Java Programming · question 98

Q98

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

A.
The new object replaces the older object
Answer
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

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board