Tag: Lambda

Reverse elements of a Parallel Stream in Java

In this post, we will see how to reverse elements of a parallel Stream in Java. In other words, we’ll create a new Stream which iterates the elements of specified stream in reverse order. Get great deals at Amazon

Java 8 Stream.reduce() method code examples

We can perform reduction operation on elements of the stream by using Stream.reduce() method that returns an Optional describing the reduced object or the the reduced value itself. In this post, we will see few simple example of Stream.reduce() method.

Reverse a Sequential Stream in Java

In this post, we will discuss how to reverse a sequential Stream in Java. Since streams don’t store any elements, an intermediate collection is used to create a new stream which iterates elements of the specified stream in reverse order.