Java 15 - Everything You Need to Know
- schick09
- Jul 12, 2025
- 2 min read
Released on September 15, 2020, Java 15 continues the trend of steady, six-monthly improvements to the Java platform. While it’s not a Long-Term Support (LTS) release like Java 11 or Java 17, it offers powerful new tools, enhancements, and refinements that can improve productivity and performance.
Let’s take a tour of some of the major features and changes introduced in Java 15 — from language enhancements to garbage collector updates and new incubating APIs.
Sealed Classes (Preview Feature)
Sealed classes give you fine-grained control over class hierarchies by restricting which classes or interfaces can extend or implement them.
This feature is powerful for maintaining domain integrity in things like algebraic data types and sealed APIs.
Helps catch unexpected subclassing at compile-time.
public sealed class Shape permits Circle, Square {}
final class Circle extends Shape {}
final class Square extends Shape {}
Hidden Classes
Hidden classes are classes that cannot be used directly by the bytecode of other classes. They’re intended for frameworks and dynamic code generation tools like proxies or serializers.
✅ Benefits:
Not discoverable via reflection
Lifecycle tied to the class that loaded them
Improve performance and encapsulation for dynamic languages or frameworks
Used mainly via the MethodHandles.Lookup.defineHiddenClass() API.
Z Garbage Collector
ZGC becomes a production-ready GC in Java 15!
Previously limited to experimental use, ZGC is now fully supported on Linux, macOS, and Windows. It’s designed for:
Sub-millisecond pause times
Scalability up to TBs of heap
Concurrent operations
🧹 Removal of the Nashorn JavaScript Engine – JEP 372
The long-standing Nashorn JavaScript engine has been removed from the JDK in Java 15. It was deprecated in Java 11 and has now been taken out completely.
For Java-JS interoperability, alternatives like GraalVM or external JS runtimes should be used.




Comments