Loading…
Loading…
Ten exam-style questions on HashMap, LinkedHashMap and TreeMap, Map.of and Map.ofEntries, put and getOrDefault return values, putIfAbsent and replace, forEach and entrySet, and the null rules of merge and the compute methods, with explanations.
Practice questions for the article Java Map Interface: HashMap, TreeMap and Methods like merge and compute.
For each update method, ask: is the key missing, mapped to null, or mapped to a value? Aim for at least 8 out of 10.
Quiz path: step 63. Take the quizzes in this order, after reading each article.
Previous quiz: Sets, Queues and Deques (OCP 21)
10 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.