Java 8 – How to convert String to LocalDate
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…
Favourite tutorials for developers
Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It is a general-purpose programming language intended to let programmers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile.
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…
In Java 8, Function is a functional interface; it takes an argument (object of type T) and returns an object (object of type R). The argument and output can be…
In Java 8, BiFunction is a functional interface - BiFunction; it takes two arguments and returns an object. T – Type of the first argument to the function. U –…
In Java 8, the double colon (::) operator is called method references. There are four kinds of method references: 1 - Reference to a static method ClassName::staticMethodName, 2 - Reference…
In this example, we will show you how to use Java 8 Lambda expression to write a Comparator to sort a List. To compare the Developer objects using their age.…
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()