Skip to content
Sharp

Core Java · interview question

Which collection is most suitable for storing unique elements with no concern for order?

Multiple choiceEasychapter-4-curatedpremiumcore-javacode-reading-with-collections
Choose one answer
Answer and explanation

Correct answer

B. HashSet

Why

HashSet is designed to store unique elements without maintaining any specific order, making it the best choice for this requirement.

Test yourself on Core Java

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

Start free test
All Core Java questions →