🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: HashMap and Maps: all 10 questions

Quiz: HashMap and Maps · Question 4 of 10

Which Map keeps its keys sorted?

Which Map keeps its keys sorted?

  1. A.HashMap
  2. B.LinkedHashMap
  3. C.TreeMap
  4. D.Hashtable
Answer & explanation

Correct answer: TreeMap

TreeMap is a red-black tree ordered by keys.

Can you get the rest right without peeking?

Take the timed Quiz: HashMap and Maps quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →