Home / Programming MCQs / JAVA MCQs / Question

P

Pushkar • 380 Points
Valuable

Q. What is the difference between an intermediate operation and a terminal operation in a stream pipeline?

(A) Intermediate operations modify the stream, while terminal operations do not.
(B) Intermediate operations are evaluated lazily, while terminal operations are evaluated eagerly.
(C) Intermediate operations are executed sequentially, while terminal operations are executed in parallel.
(D) Intermediate operations return a new stream, while terminal operations return a non-stream result.
Explanation by: Pushkar
Intermediate operations transform the stream into a new stream, while terminal operations produce a result or a side-effect.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.