Java 15

Java 15 – Overview

Java 15 introduced few language specific features under preview mode to Java and multiple JVM enhancements. This is an introductory tutorial that explains the basic-to-advanced features of Java 15 and their usage in a simple and intuitive way.

This tutorial is designed for Java programmers who would like to understand the Java 15 new features and actual usage.

Prerequisites

Before proceeding with this tutorial, you should have a good understanding of Java programming language.

Java 15 is a major feature release and it has brought many JVM specific changes and language specific changes to JAVA. It followed the Java release cadence introduced Java 10 onwards and it was released on Sep 2020, just six months after Java 14 release.

Java 15 is a non-LTS release.

New Features

Following are the major new features which are introduced in Java 15.

  1. JEP 360 – Sealed Classes − To provide fine grained control over the inheritance.
  2. JEP 368 – Text Blocks − A second preview feature to handle multiline strings like JSON, XML easily.
  3. JEP 375 – Pattern matching Type Check − enhancements to existing pattern matching preview feature of Java 14.
  4. JEP 371 – Hidden Classes − To allow runtime creation of non-discoverable classes.
  5. JEP 384 – Records − A preview feature enhancing a new type record introduced in Java 14.
  6. JEP 383 – Foreign Memory Access API − Enhancement to incubating feature of java 14.
  7. JEP 377, 379 – Garbage Collectors − ZDC and Shenandoah garbage collectors are now part of standard API.
  8. JEP 339 – Edwards-Curve Digital Signature Algorithm (EdDSA) − Cryptographic signatures are now implemented using EdDSA.
  9. JEP 373 – Reimplement the Legacy DatagramSocket API − legacy implementations of the java.net.DatagramSocket and java.net.MulticastSocket APIs are replaced with simpler and more modern implementations which are easy to maintain and debug.

Java 15 enhanced numerous APIs with new methods and options. We’ll see these changes in next chapters.

About the Author: Elavarasan PK

Technical Specialist, Intersoft Data Labs