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
Core Java is the fundamental form of Java. We use it in all Java platforms and technologies. Without going through core Java, it is impossible to advance to advanced Java. Unlike core Java, advanced Java is a specialization of the core Java in some particular domain, such as database handling, networking, and the web.
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()