Search the courses, subjects, tracks, games and features, or jump straight to a page.
5 cards from this section. Quick, good the night before a test.
What is a Map in Java?
Think of examples like dictionaries or address books.
Name one implementation of the Map interface.
Recall the different types we discussed.
Which of the following implementations allows null keys?
Think about the restrictions for keys.
True or False: A LinkedHashMap maintains the order of elements.
Recall how LinkedHashMap stores elements.
Design a small phone book application using HashMap, where the name is the key and the phone number is the value. Show how you would add and retrieve entries.
Think about defining your map and using put/get methods.
You are required to create a voting system that keeps track of the number of votes each candidate receives. Use a TreeMap where the candidate names are keys and the votes are values. How would you implement the updating mechanism?
Reflect on how you'd maintain order and update the values.
6 more questions in this section. Enroll free to practise them all.
Enroll free