Java 8 UnaryOperator Examples
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…
Favourite tutorials for developers
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…
Jackson provide writeValue() and readValue() methods to convert Java objects to / from JSON. mapper.writeValue – Java Objects to JSON. mapper.readValue – JSON to Java Objects.
In this tutorial, we will show you how to use Jackson 2.x to convert Java objects to / from a JSON: writeValue(...) – Java Objects to JSON , readValue(...) –…
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…