Question
In Java, which comparison about Parallel Streams is accurate?
- There is no practical difference in behavior, performance, or API design when Parallel Streams is involved.
- The oldest option related to Parallel Streams is always the right production choice regardless of context.
- Differences around Parallel Streams are mostly cosmetic, so correctness and maintainability do not change.
- They can help on large CPU-bound workloads with independent operations, but they often hurt small or blocking workloads.
Hint
Focus on the behavior or tradeoff, not just the keyword.
Answer and rationale
Correct answer: D. They can help on large CPU-bound workloads with independent operations, but they often hurt small or blocking workloads.
They can help on large CPU-bound workloads with independent operations, but they often hurt small or blocking workloads. This is the comparison that usually separates memorization from understanding.
Track: Java