Top Features of Java 21
37mIntermediate2025-09-04
Authors

Bethan Palmer
Developer
Course details
In this course, developer Bethan Palmer guides you through the top features of Java 21. After an overview of the Java release cycle, dive into string templates, sequenced collections, and record patterns. Learn about pattern matching with switch statements, as well as how to use unnamed patterns and variables. Discover the new way to define main methods and find out what an unnamed class is. Plus, explore virtual threads and generational ZGC.
Learning objectives
Recall the most common features of Java 21
Summarize what each feature is
Demonstrate how to use the features
Learning objectives
Recall the most common features of Java 21
Summarize what each feature is
Demonstrate how to use the features
Skills covered
JavaOracleProgramming LanguagesSoftware DevelopmentOne-Off
Concepts
Introduction
- Learn Java 21's top features
Java Release Cycle
- Understand the Java release cycle
String Templates
- Using String templates
Sequenced Collections
- Using sequenced collections
Record Patterns
- Using record patterns
Pattern Matching for Switch Statements
- Using pattern matching for switch
Unnamed Patterns and Variables
- Using unnamed patterns
- Using unnamed variables
Unnamed Classes and Instance main Methods
- Using unnamed classes and instance main methods
Virtual Threads
- What are virtual threads
- Using virtual threads
Generational ZGC
- What is Generational ZGC
- How does Generational ZGC work
Conclusion
- Next steps