J.IV · Java 25 practice question
Which of the following groups contains only known subinterfaces of SequencedCollection<E> in Java SE 25?
Check answer and explanation
Correct answer: List<E>, Deque<E>, and SortedSet<E>
Explanation
List<E>, Deque<E>, and SortedSet<E> are all retrofitted as subinterfaces of SequencedCollection<E> because they have a defined encounter order.
Common trap
General Set<E> and Queue<E> do not guarantee a defined encounter order and are not subinterfaces of SequencedCollection<E>. Map<K, V> does not extend Collection or SequencedCollection; sequenced maps use the separate SequencedMap interface.
Source: Java SE 25 API: SequencedCollection
Checked against the cited text on 2026-11-25.