Question
In Java, which comparison about ConcurrentHashMap and Concurrent Collections is accurate?
- There is no practical difference in behavior, performance, or API design when ConcurrentHashMap and Concurrent Collections is involved.
- It usually scales better than wrapping a plain HashMap with one synchronized lock around every access.
- The oldest option related to ConcurrentHashMap and Concurrent Collections is always the right production choice regardless of context.
- Differences around ConcurrentHashMap and Concurrent Collections are mostly cosmetic, so correctness and maintainability do not change.
Hint
Focus on the behavior or tradeoff, not just the keyword.
Answer and rationale
Correct answer: B. It usually scales better than wrapping a plain HashMap with one synchronized lock around every access.
It usually scales better than wrapping a plain HashMap with one synchronized lock around every access. This is the comparison that usually separates memorization from understanding.
Track: Java