Home > Java > Javagetting Started > body text

What are the new features of java8

王林
Release: 2020-10-26 15:32:12
Original
49868 people have browsed it

The new features of java8 are: 1. Lambda expression; 2. Method reference; 3. Default method; 4. New compilation tool; 5. Stream API; 6. Date Time API; 7. Option; 8. Nashorn javascript engine.

What are the new features of java8

Java8 has added a lot of new features, we mainly discuss the following:

(Learning video recommendation: java course )

1. Lambda expression

Lambda allows a function to be used as a parameter of a method (the function is passed into the method as a parameter).

2. Method reference

Method reference provides a very useful syntax that can directly reference methods or constructors of existing Java classes or objects (instances). Used in conjunction with lambda, method references can make the language structure more compact and concise and reduce redundant code.

3. Default method

The default method is a method that has an implementation in the interface.

4. New tools

New compilation tools, such as: Nashorn engine jjs, class dependency analyzer jdeps.

5. Stream API

The newly added Stream API (java.util.stream) introduces the true functional programming style into Java.

6. Date Time API

Strengthen the processing of date and time.

7. Optional class

The Optional class has become part of the Java 8 class library and is used to solve null pointer exceptions.

8. Nashorn JavaScript engine

Java 8 provides a new Nashorn javascript engine, which allows us to run specific javascript applications on the JVM.

Related recommendations:Getting started with java

The above is the detailed content of What are the new features of java8. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template