JAVATPOINT--JAVA 8-FEATUR
JAVATPOINT--JAVA 8-FEATUR
Oracle released a new version of Java as Java 8 in March 18, 2014. It was a
revolutionary release of the Java for software development platform. It includes
various upgrades to the Java programming, JVM, Tools and libraries.
Lambda expressions,
Method references,
Functional interfaces,
Stream API,
Default methods,
Base64 Encode Decode,
Static methods in interface,
Optional class,
Collectors class,
ForEach() method,
Parallel array sorting,
Nashorn JavaScript Engine,
Parallel Array Sorting,
Type and Repating Annotations,
IO Enhancements,
1 Lambda Expressions
2 Method References
Concurrency Enhancements,
3-Functional Interface
4 Optional
Java introduced a new class Optional in Java 8. It is a public final class which is
used to deal with NullPointerException in Java application. We must import
java.util package to use this class. It provides methods to check the presence of
value for particular variable.
5 forEach
This method takes a single parameter which is a functional interface. So, you can
pass lambda expression as an argument.
6 Date/Time API
Java has introduced a new Date and Time API since Java 8. The java.time package
contains Java 8 Date and Time classes.
7 Default Methods
Java provides a facility to create default methods inside the interface. Methods
which are defined inside the interface and tagged with default keyword are known as
default methods. These methods are non-abstract methods and can have method body.
9 StringJoiner
11 Stream API