← Quiz: Java Collections (List and Set): all 10 questions
Quiz: Java Collections (List and Set) · Question 2 of 10
Which collection keeps elements SORTED automatically?
Which collection keeps elements SORTED automatically?
- A.HashSet
- B.ArrayList
- C.TreeSet
- D.LinkedHashSet
Answer & explanation
Correct answer: TreeSet
TreeSet stores elements in sorted order.
Can you get the rest right without peeking?
Take the timed Quiz: Java Collections (List and Set) quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →