The Eckel Index: New language features from Java 9 through Java 17

July 1, 2022 | 2 minute read
Alan Zeichick
Editor in Chief, Java Magazine
Text Size 100%:

A summary of many of the most important language improvements since Java 8

Download a PDF of this article

Earlier in 2022, Java Magazine published seven articles by Bruce Eckel (author of On Java 8 version 2) that describe new features added to the Java language since Java 8, covering everything through Java 17. Readers requested a list of the topics covered in those seven articles; here’s the list.

Note that all the source code for these articles can be found on GitHub.

Article #1: Simplifying local variable type inference

The var keyword

Type inference

Generics

Article #2: Java records

The record keyword

Canonical constructors

Compact constructors

Article #3: Interfaces and sealed classes

The default and static methods

Sealed classes

Sealed interfaces

Subclasses of a sealed class

Article #4: Switch expressions, arrow syntax, and case null

The arrow syntax (->) in case clauses in a switch

The case null clause in a switch

Using switch as an expression

Article #5: Pattern matching

Pattern matching for instanceof

The bigger picture of pattern matching

Selector expressions

Article #6: Pattern matching guards and dominance

Guards

Dominance

Coverage

Article #7: Java modules, text blocks, and more

Modules

Text blocks

Better NullPointerException reporting

Effectively final variables in try-with-resources

Dig deeper

Alan Zeichick

Editor in Chief, Java Magazine

Alan Zeichick is editor in chief of Java Magazine and editor at large of Oracle’s Content Central group. A former mainframe software developer and technology analyst, Alan has previously been the editor of AI Expert, Network Magazine, Software Development Times, Eclipse Review, and Software Test & Performance. Follow him on Twitter @zeichick.

Show more

Previous Post

Java garbage collection: The 10-release evolution from JDK 8 to JDK 18

Thomas Schatzl | 19 min read

Next Post


Pattern matching updates for Java 19’s JEP 427: when and null

Nicolai Parlog | 6 min read
Oracle Chatbot
Disconnected