R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which Map implementation is suitable for caching with auto-removal?

  • (A) HashMap
  • (B) WeakHashMap
  • (C) TreeMap
  • (D) LinkedHashMap
  • Correct Answer - Option(B)
  • Views: 12
  • Filed under category Java
  • Hashtags:

Explanation by: Ram Sharma
`WeakHashMap` allows keys to be garbage-collected, making it suitable for caching.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.