Java Quiz 49 - Can a HashMap contains duplicate keys? #java #quiz

preview_player
Показать описание
Java Quiz 49: Can a HashMap contain duplicate keys?
In a HashMap, each key must be unique. If you try to insert a duplicate key, the old value will be replaced by the new value. This fundamental behavior is key to how the HashMap class operates. Do you know why this happens? Test your Java knowledge with this quiz!

#java #quiz #javaquiz #javamcq #codingtips
Рекомендации по теме
Комментарии
Автор

B, but values will have duplicate values

arthamvenkatesh
Автор

The answer to the question is, "NO." However, hashMap can contain duplicate keys, but the last key will override the previous key

nicolegeorge