Recently, Oracle announced Java version 16 with 17 new enhancements, including language improvements, tools, memory management, preview features and more.
Java is one of the most powerful programming languages and the development platform of choice for enterprises and developers worldwide. The language is ideal for driving innovation, shortening development timeframes, improving application services, among others.
Register for ML Fridays by AWS
Oracle rolls out Java updates every six months to deliver continued performance, stability and security improvements for developers. The latest Java Development Kit (JDK) includes features like Pattern Matching for instanceof and Records, the previously premiered language enhancements in Java version 14.
Georges Saab, vice president of development at Java Platform Group of Oracle, said features like Pattern Matching and Records were launched a year ago as part of JDK 14 and have gone through multiple feedback rounds, based on real-world applications. This provided developers with the opportunity to experiment with these features and develop robust features suited for the community.
The essential updates and features of Java 16 are as follows:
Pattern Matching for instanceof & Records
The two features, Pattern Matching and Records, were launched a year ago as part of Java Development Kit (JDK) in version 14 and are now included in the new version. The Pattern Matching for instanceof enhances the Java programming language with pattern matching for the instanceof operator. It allows common logic in a program, namely the conditional extraction of components from objects, to be expressed more concisely.
The Records feature improves the Java language with records, mainly the classes that work as transparent carriers for immutable data. Records can be thought of as nominal tuples. It also allows the ability to declare local record classes, local enum classes, and local interfaces.
Packaging Tool
Packaging Tool improves the productivity of the developers. It comes with jpackage tool for packaging self-contained Java applications. Further, the feature allows support to native packaging formats, launch-time parameters, among others.
Know more here.
Elastic Metaspace
Elastic Metaspace facilitates memory management and improves the performance of the language and virtual machine. It returns unused HotSpot class-metadata (i.e., metaspace) memory to the operating system promptly, reduces metaspace footprint, and simplifies the metaspace code to reduce maintenance costs.
Know more here.
UNIX-Domain Socket Channels
UNIX-Domain Socket Channels improve productivity as well as the flexibility of developers. It offers support for UNIX-domain sockets features, which are common across both the UNIX platforms and Windows to the socket channel and server-socket channel APIs in the java.nio.channels package. UNIX-domain sockets are utilised for inter-process communication on the same host. They are usually similar to the TCP/IP sockets, except the former are addressed by filesystem pathnames rather than the Internet Protocol addresses and port numbers.
Know more here.
Vector API (Incubator)
Vector API (Incubator) offers an initial iteration of an incubator module to express vector computations, which compiles seamlessly at runtime to optimal vector hardware instructions on the supported CPU architectures and thus achieve superior performance to equivalent scalar computations.
Know more here.
Wrapping Up
Oracle announced the new version of Java would be released in September this year. Java 17 will include features such as:
- Enhanced Pseudo-Random Number Generators
- New macOS Rendering Pipeline
Download the latest version here.