Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What does the put method do in a Map?
Think about how you would add an item to a list.
True or False: A Map can have duplicate keys.
Consider if you can have two identical names in a contact list.
Which of the following methods adds a key-value pair to a Map?
Consider which option sounds like it relates to 'adding'.
True or False: A TreeMap automatically sorts keys.
Think about how trees grow: do they follow an order?
Create a method that counts the number of occurrences of each character in a string. Use a HashMap for this solution.
Think about how you can check if a character already exists in your Map.
Implement a contact manager using a LinkedHashMap where you can add, find, and update contacts based on unique names.
Consider what happens when you want to look for a name: does order matter?
5 more questions in this section. Enroll free to practise them all.
Enroll free