Martin Ahrer

Thinking outside the box

Java 15 major language and API improvements

2024-08-23 2 min read Martin

Java ⑮ has been released in September 2020.

The following content is summarizing the most important changes to the Java API, the Java language, and the JVM introduced with Java ⑮.

For a more complete overview follow the links in the following sections referring to the official Oracle release documents.

Java 15 Language improvements

The following describes selected improvements of the Java language. See the Java 15 release notes.

With JEP 378, Text Blocks introduced in Java 13 are now moving from preview state to general availability.

Java 15 is introducing the following language enhancements as developer preview.

  • JEP 360 is introducing Sealed Classes.

  • JEP 375 is continuing with Pattern Matching for instanceof in preview state.

  • JEP 384 is continuing with Record in preview state.

We are not diving into the details of these preview features and defer that until they are moving from preview for general availability.

Text Block

Multiline Text Block
var happy=String.format("""
    With Java %s finally multiline text blocks (JEP 378) have arrived.
    Line breaks covered and substitution supported.
    """, 15);

Java 15 API improvements

The following describes selected improvements of the Java API. See the Java 15 release notes.

CharSequence

Is Empty
CharSequence happy = String.format("""
    With Java %s finally multiline text blocks (JEP 378) have arrived.
    Line breaks covered and substitution supported.
    """, 15);

assertFalse(happy.isEmpty());