Method takeWhile() of Stream object in Java

This method was added from Java 9.

The parameter of this method is the Predicate interface and this method takes the elements in your Stream object from left to right, until the condition of the Predicate object is no longer fulfilled. Example:

In… Read More

Reactive Streams in Java

Reactive Streams are a concept that defines the mechanism for handling streams asynchronously with non-blocking back pressure. Back pressure here, we can understand that there is too much work to do at the same time, then it should lead to overload. Non-blocking back pressure means… Read More

Using flatMap() method of Stream object in Java

When working with Stream in Java, sometime we can have a Stream with datatype of a List, Set or Array of object. For example:

Here, we have List of List of String object and when convert into Stream object, we have Stream of List… Read More