A

Admin • 828.03K Points
Coach

Q. Which of these Map implementations is ordered and thread-safe?

  • (A) TreeMap
  • (B) Collections.synchronizedMap(new LinkedHashMap<>())
  • (C) HashMap
  • (D) EnumMap
  • Correct Answer - Option(B)
  • Views: 10
  • Filed under category Java
  • Hashtags: Java Map

Explanation by: Admin
You can wrap LinkedHashMap with Collections.synchronizedMap() for order and thread safety.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.