Skip to content
Sharp

Collections · interview question

Which of the following operations is not supported by the Set interface?

Multiple choiceMediumchapter-4-curatedpremiumcollectionsset-interface-and-hashset
Choose one answer
Answer and explanation

Correct answer

D. Accessing elements by index

Why

Sets do not support accessing elements by index because they do not maintain any order of elements. Lists, on the other hand, support this operation.

Test yourself on Collections

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

Start free test
All Collections questions →