- Java 15 - Deprecation & Removals
- Java 15 - Other Enhancements
- Java 15 - Deprecation & Removals
- Java 15 - Other Changes
- Java 15 - Garbage Collectors
- Java 15 - Hidden Classes
- Java 15 - record & Sealed Classes
- Java 15 - record
- Java 15 - Text Blocks
- Java 15 - Pattern for instanceOf
- Java 15 - Sealed Classes
- Java 15 - Environment Setup
- Java 15 - Overview
- Java 15 - Home
Java Other Versions Tutorials
- Java 14 Tutorial
- Java 13 Tutorial
- Java 12 Tutorial
- Java 11 Tutorial
- Java 10 Tutorial
- Java 9 Tutorial
- Java 8 Tutorial
- Java Tutorial
Java 15 Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java 15 - Hidden Classes
Java 15 has introduced hidden classes which cannot be used directly by other classes bytecode. These hidden classes are intended to be used by frameworks which genereate classes at runtime and use them using reflection.
A hidden class is defined as a member of Nest Based Access Control Context and it can be unloaded inrespective of other classes.
This proposal, JEP 371, aims at improvement of all languages on JVM by providing a standard API to define hidden classes which are not discoverable and have pmited pfecycle. JDK frameworks or external frameworks can generate classses dynamically which can generate hidden classes.
JVM languages repes heavily on dynamic class generation for flexibipty and efficiency.
Goals
Following is the pst of targetted goals of this enhancement.
Frameworks should be able to define classes as non-discoverable implementation details of the framework, These classes cannot neither be pnked to other classes nor discoverable using reflection.
Extend Access Control Nest with non-discoverable classes.
Aggressive unloading of hidden classes which will help frameworks to define as many as hidden classes as required without degrading the performance.
Depreate the non-standard API, misc.Unsafe::defineAnonymousClass, to be removed in future release.