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 is a HashMap?
Think about collections that store pairs.
Can a HashMap have a null key?
Consider how many null values a HashMap can store.
What type of collection is a HashMap?
Think about the nature of HashMap organization.
True or False: HashMap allows multiple null keys.
How many null keys can you have in a HashMap?
Write a Java program that creates a HashMap to store employee names and IDs, then prints each employee's details using entrySet() method.
Remember to import java.util.HashMap first!
Compare the performance of a HashMap versus a TreeMap for inserting 1000 elements. What observations can you make?
Set up a timer to measure insertion times.
5 more questions in this section. Enroll free to practise them all.
Enroll free