Java 8 Parallel Streams Examples
Few Java 8 examples to execute streams in parallel: BaseStream.parallel() or Collection.parallelStream() . We can check to see that by default, parallel streams use `ForkJoinPool`. We can use Parallel streams…
Favourite tutorials for developers
Few Java 8 examples to execute streams in parallel: BaseStream.parallel() or Collection.parallelStream() . We can check to see that by default, parallel streams use `ForkJoinPool`. We can use Parallel streams…
In Java 8, UnaryOperator is a functional interface and it extends Function. The UnaryOperator takes one argument, and returns a result of the same type of its arguments. The Function…
In Java 8, BinaryOperator is a functional interface and it extends BiFunction. The BinaryOperator takes two arguments of the same type and returns a result of the same type of…
In this article, we will show you a few StringJoiner examples to join String. Join String by a delimiter and starting with a supplied prefix and ending with a supplied…
In Java, we can use String.join(",", list) to join a List String with commas. We also can use Stream Collectors.joining or even in old days we create a custom method…
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 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…