Deep dive into Java 8 Stream API

Deep dive into Java 8 Stream API

Another day, Another concept !!!

Well ! Well ! Java has started mutating towards the functional realm of immutation (since Java 8) !!! Today let us dive in to understanding what good Java-8 Stream API holds. Java8 Streams are the primary object structures for defining (and conducting) a chain of pure functions(lambda) for performing computations - upon individual members of a data structure, which in turn continues holding the data - in an efficient manner within JVM. And Java 8 Streams does it all without even holding the data !!!

The streams API was added in Java 8 to ease the task of performing bulk operations, sequentially or in parallel. This API provides two key abstractions: the stream, which represents a finite or infinite sequence of data elements (remember !!! without holding the data), and the stream pipeline, which represents a multistage computation on these elements. The elements in a stream can come from anywhere. Common sources include collections, arrays, files, regular expression pattern matchers, pseudorandom number generators, and other streams. The data elements in a stream can be object references or primitive values. Three primitive types are supported: int, long, and double

An elaborate Mindmap from my study board covering this interesting API from the coffers of #Java8#functionalprogramming #reactiveprogramming

No alt text provided for this image

Namaste !!!

To view or add a comment, sign in

More articles by Gaurav Jain

Explore content categories