Java 8 – Lambda expressions

Java 8 Lambda expressions

Let us look at lambda expressions, which is one of the most important features introduced in java 8. Before we look at lambda expressions, let us first understand the functional interfaces and anonymous classes. What is functional interface? Functional interface means an interface that has exactly one abstract method. They have only one functionality to … Read more

Java 8 flatMap examples

We would be looking at flatMap method in Java 8 streams and Optional. In our last tutorial we looked at map method in Java 8 stream example. Let us start with the examples 1. Flatten a List<List<String>> to List<String> using flatMap Here we have two lists, a list of front-end languages and a list of … Read more

Java 8 map method Examples

Java 8 map method example

In Java 8 streams map() method is one of the most important and the widely used methods of streams. In this tutorial, we would be looking at various ways we can use map method. These examples can help you understand the usage of Java 8 stream map() method. The javadocs describes the example:() method as: … Read more

Java 8 streams – List to Map examples

In this tutorial, we would be looking at the various examples of using streams introduced in Java 8 to create a Map from a List of values. I have been working with Java 8 for quite a while and have found streams extremely useful. Almost every single day I am writing code using streams.  We … Read more