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.
πŸ’¬ Discuss
βœ… Correct Answer: (A) Intermediate operations modify the stream, while terminal operations do not.
Explanation: Intermediate operations transform the stream into a new stream, while terminal operations produce a result or a side-effect.
Explanation by: Pushkar
Intermediate operations transform the stream into a new stream, while terminal operations produce a result or a side-effect.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
234
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Pushkar
Publisher
πŸ“ˆ
86%
Success Rate