Skip to content
Sharp

Collections · interview question

Which of the following statements about HashMap is true?

Multiple choiceMediumchapter-4-curatedpremiumcollectionsmap-interface-and-hashmap
Choose one answer
Answer and explanation

Correct answer

B. HashMap allows one null key and multiple null values.

Why

HashMap allows one null key and multiple null values. It does not maintain insertion order and is not synchronized by default; if thread safety is needed, it should be externally synchronized.

Test yourself on Collections

A free test with instant, explained results. No account needed.

Start free test
All Collections questions →