Skip to content
Sharp

Collections · interview question

Which Java collection is typically used to store pairs of keys and values?

Multiple choiceEasychapter-4-curatedpremiumcollectionscollection-performance-basics
Choose one answer
Answer and explanation

Correct answer

C. HashMap

Why

HashMap is the collection used for storing pairs of keys and values, allowing for efficient retrieval based on keys.

Test yourself on Collections

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

Start free test
All Collections questions →