![Java 8 features interview questions Java 8 features interview questions](https://2.bp.blogspot.com/-7mPEqHCN3Ds/W8dzO1e58BI/AAAAAAAAEXc/rC5K-wGSevkSIZe0LF3P1sqTl5Eo3quRQCLcBGAs/s1600/java-8-features-vertical.png)
JAVA 8 is a major feature release of JAVA programming language development. Its initial version was released on 18 March 2014. With the Java 8 release, Java provided supports for functional programming, new JavaScript engine, new APIs for date time manipulation, new streaming API, etc.
New Features
Java Platform, Standard Edition 8 is a major feature release. This document summarizes features and enhancements in Java SE 8 and in JDK 8, Oracle's implementation of Java SE 8. Click the component name for a more detailed description of the enhancements for that component. Lambda Expressions, a.
Lambda expression − Adds functional processing capability to Java.
Method references − Referencing functions by their names instead of invoking them directly. Using functions as parameter.
Default method − Interface to have default method implementation.
New tools − New compiler tools and utilities are added like ‘jdeps’ to figure out dependencies.
Stream API − New stream API to facilitate pipeline processing.
Date Time API − Improved date time API.
Optional − Emphasis on best practices to handle null values properly.
Nashorn, JavaScript Engine − A Java-based engine to execute JavaScript code.
Consider the following code snippet.
Live DemoRun the program to get the following result.
Here the sortUsingJava8() method uses sort function with a lambda expression as parameter to get the sorting criteria.