In java we heavily use Collection. Right? We store our data in a suitable collection and then we keep on taking the data from the collection wherever needed, we may process the data or we use the data and most of the time we use iterators to get the data. So we keep on playing […]
Author: admin
The Agenda of this post is to make you understand how Streams works internally in Java and how to implement your custom Spliterator Streams in Java 8 and beyond are the most favorite Objects used to process the data. Every Collection object in Java returns the Stream Object provided by JDK in JDK 8 and […]
Some of the developers are sometimes getting confuse stream with collections. Stream is not collection and does not contain any data. Stream is indeed a fancy iterator which just takes the data from a source and process that only once. Stream does not hold any data but processes the elements one by one. Just like […]
Consider the book example, This looks like a pipeline of operations on the stream. Break it up to multiple steps: Creation of Stream Stream method on Collection will return a Stream of all the elements present in that collection. Filtering the Stream To filter out stream to have only horror books: This operation is performed […]