1 Java Language Changes Summary
The following tables summarize new Java language features since Java SE 9.
New Language Features
The following table lists the new features in the Java language since Java SE 9.
Table 1-1 Java Language Changes Summary
Release | New Language Features |
---|---|
9 |
Java Platform Module System (JSR 376): see Project Jigsaw on OpenJDK Milling Project Coin ( JEP 213): seeJava Language Changes for Java SE 9 Small Enhancements to the Java Programming Language (JSR 334): see Java Language Changes for Java SE 9 |
10 |
|
11 |
Local-Variable Syntax for Lambda Parameters (JEP 323): see Local Variable Type Inference |
14 |
|
15 |
|
16 |
|
17 |
|
21 |
|
22 |
Permanent and Preview Language Features
The following table lists, for each release since Java SE 9, which language features became permanent and which language features were in preview. See Preview Features for information about preview features and how they can become permanent.
Table 1-2 Java Language Changes Summary
Release | Permanent Features | Preview Features |
---|---|---|
23 |
Primitive Types in Patterns, instanceof, and switch |
|
22 |
||
21 |
||
20 |
||
19 |
||
18 |
||
17 |
||
16 |
||
15 |
||
14 |
||
13 |
Text Blocks, see Programmer's Guide to Text Blocks |
|
12 |
||
11 |
Local-Variable Syntax for Lambda Parameters (JEP 323): see Local Variable Type Inference |
|
10 |
||
9 |
Java Platform Module System (JSR 376): see Project Jigsaw on OpenJDK Milling Project Coin (JEP 213): see Java Language Changes for Java SE 9 Small Enhancements to the Java Programming Language (JSR 334): see Java Language Changes for Java SE 9 |
Evolution of Language Features
The following tables list the changes made to the Java language since Java SE 9. The first column specifies the feature while the subsequent columns specify a Java SE release. An icon specifies whether the feature was made permanent, withdrawn for the specified release, or available as a preview feature:
: Permanent feature
-
: The feature was withdrawn
-
,
,
,
: First, second, third, or fourth preview, respectively
See Preview Features for information about preview features and how they can become permanent or be withdrawn.
Table 1-3 Java Language Changes from Java SE 23 to Java SE 17
Feature | 23 | 22 | 21 | 20 | 19 | 18 | 17 |
---|---|---|---|---|---|---|---|
Module Import Declarations | ![]() |
||||||
Primitive Types in Patterns, instanceof, and switch | ![]() |
||||||
Flexible Constructor Bodies | ![]() |
![]() |
|||||
Simple Source Files and Instance Main Methods | ![]() |
![]() |
![]() |
||||
Unnamed Variables and Patterns | ![]() |
![]() |
|||||
String Templates | ![]() |
![]() |
![]() |
||||
Record Patterns | ![]() |
![]() |
![]() |
||||
Pattern Matching with switch | ![]() |
![]() |
![]() |
![]() |
![]() |
||
Sealed Classes | ![]() |
Table 1-4 Java Language Changes from Java SE 16 to Java SE 9
Feature | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 |
---|---|---|---|---|---|---|---|---|
Sealed Classes | ![]() |
![]() |
||||||
Record Classes | ![]() |
![]() |
![]() |
|||||
Pattern Matching with instanceof | ![]() |
![]() |
![]() |
|||||
Text Blocks | ![]() |
![]() |
![]() |
|||||
Switch Expressions and Statements | ![]() |
![]() |
![]() |
|||||
Local-Variable Syntax for Lambda Parameters: see Local Variable Type Inference | ![]() |
|||||||
Local Variable Type Inference | ![]() |
|||||||
Java Platform Module System: see Project Jigsaw on OpenJDK | ![]() |
|||||||
Milling Project Coin: see Java Language Changes for Java SE 9 | ![]() |
|||||||
Small Enhancements to the Java Programming Language: see Java Language Changes for Java SE 9 | ![]() |