in JAVA by (32.2k points)
What do you mean by saying Stream is lazy?

1 Answer

0 votes
by (32.2k points)
When we say Stream is lazy, we mean that most of the methods defined on Java class is lazy i.e. they will not work by just including them on Stream pipeline.

They only work when you call a terminal method on the Stream and finish as soon as they find the data they are looking for rather than scanning through the whole set of data.

Related questions

+1 vote
asked Apr 15, 2021 in JAVA by SakshiSharma (32.2k points)
0 votes
0 votes
asked May 31, 2022 in JAVA by Robin (14.6k points)
0 votes
asked Feb 8, 2021 in JAVA by SakshiSharma (32.2k points)