Which core Java collection interface models a collection with no duplicate elements?
Correct answer B. Set
Explanation
The Set interface models the mathematical idea of a set, so adding an element equal to one already present leaves the collection unchanged and add returns false. List and Deque allow duplicates and keep positional or end-based access, and a Queue is designed for holding elements before processing. Equality is decided by equals.
Answer checked How we write and check questions
Discussion