0 votes
in JAVA by
What distinguishes Stream's Intermediate and Terminal Operations?

1 Answer

0 votes
by
All stream operations fall into one of two categories: Terminal or Intermediate. The operations known as intermediate operations are those that release the stream so that subsequent operations can be performed on it. Lazy operations are intermediate operations since they do not analyze the Stream at the call point.

When a terminal operation is performed, these activities (Intermediate Operations) process data. Map and filter are two examples of intermediate operations.

Processing of Streams is started by Terminal Operations. The Stream runs through all of the Intermediate processes during this call. Sum, Collect, and forEach are some examples of terminal operations.

Related questions

0 votes
asked Feb 28, 2023 in JAVA by rajeshsharma
0 votes
asked Feb 2, 2021 in JAVA by SakshiSharma
...