Question 12
Back to Exercise
Which method do you override in LinkedHashMap to evict old entries automatically?
- A removeOldest()
- B removeEldestEntry(Map.Entry) Correct
- C evict()
- D trimToSize()
Correct Answer: Option B
Return true when size() exceeds the capacity.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!