Java 8 Stream.reduce() examples
In Java 8, the Stream.reduce() combine elements of a stream and produces a single value, with 2 arguments: 1 - identity is default or initial value, and 2 - BinaryOperator…
Favourite tutorials for developers
In Java 8, the Stream.reduce() combine elements of a stream and produces a single value, with 2 arguments: 1 - identity is default or initial value, and 2 - BinaryOperator…
In this article, we will show you how to use Java 8 Stream Collectors to group by, count, sum and sort a List, and also do a mapping.
In this article, we will show you a few ways to join a Java Array: 1 - Apache Commons Lang – ArrayUtils, 2 - Java API, 3 - Java 8…
This article explains the Java 8 Stream.flatMap and how to use it. In Java 8, we can use the flatMap to convert the above 2 levels Stream into one Stream…
Few Java examples to show you how to filter a Map with Java 8 stream API. With Java 8, you can convert a Map.entrySet() into a stream, follow by a…
In Java 8, stream().map() lets you convert an object to something else. Review the following examples : convert a list of Strings to upper case, get all the name values…
Few Java 8 examples to show you how to convert a List of objects into a Map, and how to handle the duplicated keys.
In this tutorial, we will show you few Java 8 examples to demonstrate the use of Streams filter(), collect(), findAny() and orElse()
In Java 8, Predicate is a functional interface, which accepts an argument and returns a boolean. Usually, it used to apply in a filter for a collection of objects.
If we use the NIO Files.delete to delete a non-empty directory in Java, it throws DirectoryNotEmptyException; for legacy IO File.delete to delete a non-empty directory, it returns a false. The…