Java 9 has been finally released by Oracle. Programming enthusiasts would be pretty relieved Java 9 Standard Edition was previously delayed due to modularity controversy.
If you are seeking for Java SE Development Kit 9 you can download it here DOWNLOAD
Java 9 Features with Examples
Java 9 REPL (JShell)
Oracle Corp has introduced a new tool called “jshell”. It stands for Java Shell and also known as REPL (Read Evaluate Print Loop). It is used to execute and test any Java Constructs like class, interface, enum, object, statements etc. very easily.With this new style of writing Java code, you can write and test small snippets of code quickly and easily. JShell will compile and run the code there and then.
Stream API enhancements
In Java SE 9, Oracle Corp has added four useful new methods to java.util.Stream interface. As Stream is an interface, all those new implemented methods are default methods. Two of them are very important: dropWhile and takeWhile methods
If you are familiar with Scala Language or any Functions programming language, you will definitely know about these methods.
HTTP 2 Client
Java 9 features list is incomplete without the mention of new HTTP/2 and WebSocket. It’ll improve web page loading times, performance, and reduce resource usage.They are going to introduce new HTTP 2 Client API under “java.net.http” package. It supports both HTTP/1.1 and HTTP/2 protocols. It supports both Synchronous (Blocking Mode) and Asynchronous Modes. It supports Asynchronous Mode using WebSocket API.
Мulti-Resolution Image API
MultiResolutionImage encapsulates a set of images with different Height and Widths (that is different resolutions) and allows us to query them with our requirements.
One of the big changes or java 9 feature is the Module System. Oracle Corp is going to introduce the following features as part of Jigsaw Project.
- Modular JDK
- Modular Java Source Code
- Modular Run-time Images
- Encapsulate Java Internal APIs
- Java Platform Module System
Before Java SE 9 versions, we are using Monolithic Jars to develop Java-Based applications. This architecture has lot of limitations and drawbacks. To avoid all these shortcomings, Java SE 9 is coming with Module System.
Other Java 9 Features
- GC (Garbage Collector) Improvements
- Stack-Walking API
- Filter Incoming Serialization Data
- Deprecate the Applet API
- Indify String Concatenation
- Enhanced Method Handles
- Java Platform Logging API and Service
- Compact Strings
- Parser API for Nashorn
- Javadoc Search
- HTML5 Javadoc