Question
In Java, which comparison about CopyOnWriteArrayList is accurate?
- There is no practical difference in behavior, performance, or API design when CopyOnWriteArrayList is involved.
- The oldest option related to CopyOnWriteArrayList is always the right production choice regardless of context.
- Differences around CopyOnWriteArrayList are mostly cosmetic, so correctness and maintainability do not change.
- It is excellent for read-heavy workloads, while write-heavy workloads pay a large copying cost.
Hint
Focus on the behavior or tradeoff, not just the keyword.
Answer and rationale
Correct answer: D. It is excellent for read-heavy workloads, while write-heavy workloads pay a large copying cost.
It is excellent for read-heavy workloads, while write-heavy workloads pay a large copying cost. This is the comparison that usually separates memorization from understanding.
Track: Java