Java Stream sorted operation
Using Java Stream sorted operation on a stream will return a stream with the elements of the stream sorted according to their natural order
java8
Using Java Stream sorted operation on a stream will return a stream with the elements of the stream sorted according to their natural order
We use the Java Stream’s reduce method to reduce a stream of values to a single result. There are three overloaded Stream#reduce operation.
The Java stream toArray methods, which we learn in this post, allow us to collect/convert a stream into an array.
In this post, we will learn about the functional interface in Java for functions present as part of the java.util.function namespace.
A Java DoubleStream is a sequence of double-valued elements that supports sequential and parallel aggregate operations.
Many JDK interfaces were enhanced with default methods in Java 8. In this post we will learn about the default methods in the Java Map interface.
In this post, we will see six ways to convert a Java stream to a List. You can extend these if you want to convert a stream to a Set as well.
The Java 8 LongStream is a sequence of primitive long-valued elements and is a long primitive specialization of Stream.
Java 8 StringJoiner class can be used to build a sequence of characters that are separated by a configured delimiter, prefix and a suffix.
This post shows 4 ways to throw checked exceptions in Java streams i.e., having a lambda expression that can throw checked exception(s).