Member-only story
Java 8 Features that Every Java Developer Should Know
Java 8 is one of the major Java releases packed with useful features that every Java developer should know and use. In this article, I promise to make you understand the newly added features with clear examples.

Java came into the picture in the year 1995 and still it is one of the dominating and most used programming language in the IT industry, the reason for its domination is because of its frequent feature releases which are helping it to compete with the modern day programming languages like python. Java 8 is one of the major feature release by Java which introduced functional programming into Java.
Here are the main changes which are added to Java from version 8
- Lambda Expressions
- Stream API
- Method Reference
- Default Methods
- Optional Class
1. Lambda Expressions
Before we dig into Lambda expressions, you should understand how they came into existence and what Functional Interface are!
Functional Interface — An interface which has one and only one abstract method.
Java provides an annotation @FunctionalInterface, which is used to declare an interface as functional interface.
Look at the below functional interface which has only one method which is by default abstract.

Now, you know how to create a functional interface, the next step is to implement it, how do you do that?
- Create a class X and implement the interface.
- Provide the implementation for the abstract method.
- In the main method create the object for class X and call the method.
it looks like this

don’t you think there is a lot of boiler plate code, can we improve this? Answer is absolutely yes…