Sealed Classes7 articles
Java sealed classes are a powerful feature that can help you create more robust and maintainable code by restricting the inheritance hierarchy of your classes and interfaces.
Foojay Podcast #5: OpenJDK Discussion Panel
It’s September 20th, OpenJDK 19 has been released. In this podcast, we discuss the new features and the changes that this release brings.
Getting Started with Java 17 and IntelliJ IDEA
A new Java release every six months can be exciting, overwhelming, or both. Given that Java 17 is also an LTS release, it’s not just the developers but enterprises also noticing it. If you have been waiting to move on from Java 8 or 11, now is the time to weigh its advantages.
Keeping Pace with Java Using Eclipse IDE
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.
Highlights of New JEPs in Java 16
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!
Immutable Collections in Java with Sealed Types
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.
JDK 15 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.