0% found this document useful (0 votes)
26 views1 page

Streams

Uploaded by

soumilmustafi739
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views1 page

Streams

Uploaded by

soumilmustafi739
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Streams

In Java, a stream is a sequence of elements that can be processed sequentially or in parallel.


Streams in Java are a new abstraction introduced in Java 8 to allow developers to perform
functional-style operations on collections of elements. Streams are based on the concept of
functional programming and provide a way to work with sequences of elements in a more
declarative and concise manner.

Streams in Java are designed to be processed in a pipelined fashion, where operations are
composed and executed in a lazy manner. This allows for more efficient processing of data and
better utilization of modern multi-core processors.

Streams in Java are characterized by the following key features:

 They are based on functional interfaces, such as Predicate, Function, and Consumer.
 They support intermediate operations, such as filter, map, and sorted, which allow for data
transformation and filtering.
 They support terminal operations, such as for Each, collect, and reduce, which produce a
result or side-effect.

Overall, streams in Java provide a powerful and flexible way to process collections of elements with
a focus on readability, performance, and parallelism.

There uses of Stream in Java are mentioned below:


1. Stream API is a way to express and process collections of
objects.
2. Enable us to perform operations like filtering, mapping, reducing
and sorting.

You might also like