Java 8 – Stream Collectors groupingBy examples
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.
Favourite tutorials for developers
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 print a Java Array. We can use JDK 1.5 Arrays.toString to print a simple array and Arrays.deepToString for 2d…
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…
Here are a few Java examples of converting a String to the new Java 8 Date API – java.time.LocalDate. The key is understand the DateTimeFormatter patterns. If the date is…
Few examples to show you how to format java.time.LocalDateTime in Java 8. To format a LocalDateTime object, uses DateTimeFormatter. Also we can convert a String back to LocalDateTime.
In Java 8, BiConsumer is a functional interface – BiConsumer<T, U>; it takes two arguments and returns nothing. Further Reading – Java 8 Consumer Examples 1. BiConsumer JavaBiConsumer1.java Output 2.…
In Java 8, Supplier is a functional interface; it takes no arguments and returns a result. We can use Supplier to return some values or to build factory method in…