Contact Book
60 min · Intermediate
Need help? Ask a tutor on WhatsApp (opens in a new tab)A phone's contact list is a sorted map: each name points to one contact, names never repeat, and the list always shows A to Z. A TreeMap<String, Contact> gives all three for free.
What you will learn
What you will learn
- Store objects in a TreeMap by a unique key
- Block duplicates with containsKey and Set.add
- Search a sorted map by prefix with tailMap
- Group values with computeIfAbsent
- Push a Java collections project to GitHub
Sign in to continue this lesson
Create an account to read every lesson, practise with the exercises and keep track of your progress.