Java8, also known as jdk1.8, is a major version of Java language development. Oracle released the Java 8 version on March 18, 2014, which supports functional programming, a new JavaScript engine, a new date API, etc.
New features
Java8 has added a lot of new features, we mainly discuss the following:
● Lambda expression − Lambda allows the function to be used as a parameter of a method (the function is passed into the method as a parameter.
● Method reference − Method reference provides a very useful syntax, which can directly reference the There are methods or constructors of Java classes or objects (instances). Used in conjunction with lambda, method references can make the language construction more compact and concise, reducing redundant code.
● Default method − The default method is a There is an implementation method in the interface.
● New tools − New compilation tools, such as: Nashorn engine jjs, class dependency analyzer jdeps.
● Stream API − Newly added Stream API (java.util.stream) introduces true functional programming style into Java.
● Date Time API − Enhances the processing of dates and times.
● Optional class − Optional Class has become part of the Java 8 class library to solve null pointer exceptions.
● Nashorn, JavaScript engine − Java 8 provides a new Nashorn javascript engine, which allows us to run specific javascript on the JVM application.
The above is the detailed content of What is java8?. For more information, please follow other related articles on the PHP Chinese website!