What are the major features and enhancements introduced in Java 9?
Oracle has released Java 9 version with a rich set of new features and many new Enhanced features.
Here are some of the important features and enhancements introduced in Java 9.
- Factory method of collections: Factory method is a special type of static method that can be used to create unmodifiable Collection instances, which means we can use these methods to create Lists, Collections and Maps.
- Java Platform Module System (JPMS): Java modules are a mechanism for bundling Java applications and Java packages into Java modules. It specifies which Java packages contain visible to other Java modules.
- Private methods in the interfaces: The interface is allowed to include private and private static methods, thereby improving Code reusability inside the interface.
- Java 9 REPL (Jshell) : Jshell is a REPL (read evaluation print loop) tool, Can be run from the command line. We can launch Jshell from the console and start entering and executing Java code directly.
- Improvements in resource management: Java introduced a try-with-resources feature in Java 7 that can be automatically closed after use resource.
- Diamond operator for anonymous inner classes: Java 9 introduced a new feature that allows us to use diamond## inside anonymous classes #operator.
- Improvements in CompletableFuture API: The Java 9 version improves CompletableFuture API and solves some problems that occurred in Java 8. They add support for some delays and timeouts, some utility methods and better subclassing.
- Responsive streaming: The reactive streaming API is a publish-subscribe framework that can be very easily implemented using Java language Asynchronous, Scalable and Parallel applications.
- Improvements in process API: The process API is responsible for controlling and managing operating system processes, and has been significantly improved in this regard. ProcessHandle The class can provide the native process ID, startup time, accumulated CPU time, parameters, commands, users, parent processes and child processes of the process.
- Improvements of the Optional class: In Java 9, the Optional class has three main improvements: Optional.ifPresentOrElse(), Optional.or() and Optional.stream().
- Improvements to the Stream API: The Stream API has been improved and new methods have been added to the Stream interface. Added takeWhile (), dropWhile (), ofNullable () and iterate () methods to perform operations on stream elements.
- Multi-resolution image API: The multi-resolution image API can encapsulate a set of images with different height and width , which can be customized according to our Query them on request.
- HTTP/2 Client: HTTP/2 is a new version of HTTP protocol , focusing on data between the server and the client How it is framed and transmitted. In Java 9, the HTTP Client module is bundled as an incubator module and supports HTTP/2 with Backwards Compatibility.
- Enhanced @Deprecated annotation : The @Deprecated annotation can provide more information about deprecated API. It can also provide a tool to analyze an application's static usage of deprecated APIs.
The above is the detailed content of What are the major features and enhancements introduced in Java 9?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



When using MyBatis-Plus or other ORM frameworks for database operations, it is often necessary to construct query conditions based on the attribute name of the entity class. If you manually every time...

Field mapping processing in system docking often encounters a difficult problem when performing system docking: how to effectively map the interface fields of system A...

Start Spring using IntelliJIDEAUltimate version...

Troubleshooting and solutions to the company's security software that causes some applications to not function properly. Many companies will deploy security software in order to ensure internal network security. ...

Analysis of memory leak phenomenon of Java programs on different architecture CPUs. This article will discuss a case where a Java program exhibits different memory behaviors on ARM and x86 architecture CPUs...

Conversion of Java Objects and Arrays: In-depth discussion of the risks and correct methods of cast type conversion Many Java beginners will encounter the conversion of an object into an array...

How to convert names to numbers to implement sorting within groups? When sorting users in groups, it is often necessary to convert the user's name into numbers so that it can be different...

Solutions to convert names to numbers to implement sorting In many application scenarios, users may need to sort in groups, especially in one...
