🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.HashSet
  2. B.ArrayList
  3. C.TreeSet
  4. 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 →