Oracle Certified Professional Java Se 8 Programmer · Free Practice Question Easy
Question 34
Performance with parallel stream is always better than sequential streams.
- A false
- B true
Reveal correct answer
Correct answer: A
Explanation
Parallel streams internally use fork/join framework only, so there is always an overhead of splitting the tasks and joining the results.
Parallel streams improves performance for streams with large number of elements, easily splittable into independent operations and computations are complex.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
You must be logged in to post a comment.
