Java language updates in recent java releases.

Java is continuously adding new features in its latest releases making it more exciting for the developers to use. Listed below are some of the new features introduced in java since java 9.

Note: We haven’t listed the preview features.

Java VersionFeatureDescriptionJEP
Java 17Sealed ClassesA sealed class or interface restricts which classes or interfaces can extend or implement it.JEP 409: Sealed Classes
Java 16Record ClassesRecords are classes that act as transparent carriers for immutable dataJEP 395: Records
Java 16 Pattern Matching for instanceofIt helps conditional extraction of components from objects, to be expressed more concisely and safely.JEP 394: Pattern Matching for instanceof
Java 15Text Blocks A text block is a multi-line string literal that avoids the need for most escape sequences.JEP 378: Text Blocks
Java 14Switch ExpressionsExtend switch so it can be used as either a statement or an expression. JEP 361: Switch Expressions
Java 14Helpful NullPointerExceptionJava improved the usability of NullPointerExceptions generated by the JVM by describing precisely which variable was null.JEP 358: Helpful NullPointerExceptions
Java 13 & 12Preview features of TextBlock and Switch Expressions
Java 11Local Variable Syntax for Lambda ParametersAllow var to be used when declaring the formal parameters of implicitly typed lambda expressions.JEP 323: Local-Variable Syntax for Lambda Parameters
Java 10Local Variable Type inference.
Extends type inference to declarations of local variables with initializers.
The reserved type name var was introduced.
JEP 286: Local-Variable Type Inference
Java 9Java Platform Module System
(Project Jigsaw)
The Java Platform module system introduces a new kind of Java programing component, the module, which is a named, self-describing collection of code and data.Java Platform Module System (JSR 376)
Java 9 Small language enhancements
1. More concise try-with-resources statement.
2. @SafeVarargs Annotation allowed on Private Instance methods.
3. Diamond syntax and Anonymous inner classes
4. Underscore character not legal name.
5. Support for Private Interface Methods.
Introduced in Java SE 7 as Project Coin. It has been enhanced with a few amendments.
JEP 213: Milling Project Coin
Latest Java language features by version

%d bloggers like this: