Java 8 Main Features

https://www.journaldev.com/2389/java-8-features-with-examples#iterable-forEach



1. Functional Interface
Java 8 introduced @FunctionalInterface, an interface that has exactly one abstract method. @FunctionalInterface annotation is optional.


2. Lambda Expressions & Method References
Java 8 introduced lambda expressions to provide the implementation of the abstract method of a functional interface.


3. Streams
https://mkyong.com/tutorials/java-8-tutorials/

4. New Date Time APIs
In the old days, we use Date and Calendar APIs to represent and manipulate date.

5. Optional
Java 8 has introduced Optional in java.util package. It is used to represent a value is present or absent. The main purpose of this class is to avoid too many null checks and NPE. Like List and Set, it is also a Container to hold at most one value. 

Advantages of Java 8 Optional:
Null checks are not required.
No more NullPointerException at run-time.
We can develop clean and neat APIs.
No more Boiler plate code