Skip to content

Commit f6b800c

Browse files
Feature: Added notes about Stream in the readme file.
1 parent 4deedf4 commit f6b800c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,11 @@ provides a clear and concise way to represent one method interface using an expr
212212

213213
## Explanation Stream
214214

215-
- To be defined
215+
A sequence of elements supporting sequential and parallel aggregate operations. To perform a computation, stream operations are composed into a __stream pipeline__. A stream pipeline consists of a _source_ (which might be an array, a collection, a generator function, an I/O channel, etc), zero or more intermediate operations (which transform a stream into another stream, such as _filter(Predicate)_), and a terminal operation (which produces a result or side-effect, such as _count()_ or _forEach(Consumer)_).
216+
217+
Streams are __lazy__; computation on the source data is __only performed when the terminal operation is initiated__, and source elements are consumed only as needed.
218+
219+
**Reference:** The source code for the Stream is present in [_Stream.java](https://github.com/syedumerahmedcode/java-functional-programming/blob/master/src/main/java/com/umer/javafunctional/streams/_Stream.java) class.
216220

217221
## Explanation Parallel Stream
218222

0 commit comments

Comments
 (0)