The Java language has been evolving at a fast pace with a six month release cadence and preview features.
With faster Java releases, it’s an exciting time to be a Java developer. Every new release of Java promises interesting features and updates.
To give them a spin, you have the tooling support in Eclipse Java IDE ready at your disposal.
The JDK Enhancement Proposal (or JEP) is a community process for collecting proposals for enhancements to the OpenJDK.
Java 16, released today, incorporated the JEPs listed here.
And, on foojay.io, you’ll find a long list of all the fixes that made it into the release!
JDK 15 was released on September 15, 2020. JEP 360 Sealed Types was included as a preview feature in this release, with its second preview in JDK 16.
Sealed Types is part of Project Amber. Sealed classes or interfaces can be used to restrict the interfaces or classes that are allowed to extend them.
Also learn about the source code for an experimental implementation of a collections framework can be found in the Deck of Cards Kata repo.
- Sealed Classes
The most significant new preview feature in JDK 15 (with its second preview in JDK 16), and the only change to the language, is the introduction of sealed classes as a preview feature.
Sealed classes (explained in detail in JEP 360) provide a fine-grained mechanism that allows a developer to restrict which other classes or interfaces may extend them. You can think of final classes as the ultimate sealed class since no other classes can extend them.