Java 21 Release Party
Deep Dive Into the New Features
Video available until 19. December 2023
Video available until
Discover the New Features of Java 21
Java 21 is the next major long-term support release for the popular programming language.
Many strands come together here, the experimental features reach maturity, innovations such as pattern matching, virtual threads and unnamed classes raise developer productivity to a new level.
Join our Java 21 Release Live Event to get the latest from our experts Falk Sippach, Michael Inden and Sven Woltmann.
We bring you up to speed and show you what Java 21 has to offer!
After years of development and nearly 100,000 modified lines of code in the JDK, Java 21 brings us the final version of Project Loom’s virtual threads. In this talk, you will learn everything you need to know about them.
Through an example application, you will discover what virtual threads are, why we need them, how to use them, their advantages over existing concurrent programming models, and how they work under the hood.
However, we all know that all that glitters is not gold – so you will also find out what virtual threads cannot do, when not to use them, and what pitfalls you should avoid when migrating to virtual threads.
This talk covers several interesting syntax and API innovations in the brand-new Java 21. We will cover the following JEPs:
• JEP 430: String Templates
To format strings containing texts and variable components, there are different variants in Java, starting from the simple concatenation with + up to the formatted formatting. String templates supplement the previous variants by an elegant possibility of specifying expressions, which are evaluated by a particular template processor at runtime and integrated into the string suitably.
• JEP 431: Sequenced Collections
Java’s Collection API is one of JDK’s oldest and most well-designed APIs and contains three major types: list, set, and map. What is missing is something like an ordered sequence of elements. To solve this now, «Sequenced Collections» represent a collection whose elements have a defined encounter order.
• JEP 443: Unnamed Patterns and Variables
When using record patterns, one sometimes finds that some components are not of interest during the evaluation, such as the street name of an address. Something similar is known from lambdas when not all variables on the left side are used on the right side in the expression. Also, when handling exceptions, sometimes the exception variable is not accessed. In all these cases, it would be conceptually unnecessary to name some variables explicitly, often resulting in one-letter name abbreviations. It would be better to be able to label them specifically. This JEP addresses this.
• JEP 445: Unnamed Classes and Instance Main Methods
Maybe learning Java was a while ago for you. If you want to learn or teach Java as/to novice programmers, you realize how difficult it is to get started. This JEP tries to make it easier to get started with Java and to make it as comfortable as possible for smaller experiments, especially in combination with Direct Compilation.
For ease of comprehension, notes are also provided on support for build tools and IDEs, or running on the console, as well as the Java Almanac.
Together with the final release of virtual threads, Java 21 brings us the first preview releases of structured concurrency and scoped values – two more features from Project Loom that will significantly simplify writing concurrent programs.
In part one of this talk, you will learn, through an example, how to use structured concurrency to break down a task into multiple concurrent, potentially blocking subtasks, how to merge their results, and how to cancel subtasks whose results are no longer needed – all that with just a few simple lines of code.
In part two, you’ll discover how to use scoped values to exchange immutable data between various parts of a program – without the need for method arguments or thread-local variables.
Pattern matching is a mechanism to check values against patterns. If a match is found, these values can then be broken down into their constituent parts and thus easily and safely processed further. This concept, which is primarily known from functional programming languages, is thus a very powerful and flexible alternative to classic switch statements or if/else statement cascades. For several years now, the JDK incubator project Amber has been working on the introduction of pattern matching in Java. Some of the implementations have now found their way into the OpenJDK. They promise shorter and more comprehensible source code, which can also be checked for correctness by the compiler. It is easier to read and can therefore be easily maintained and extended.
Accompanied by code examples we will take a closer look at the actual state of pattern matching in Java. You will get to know the new features like Switch Expression, Type/Record Patterns, Sealed Classes as well as Pattern Matching for switch in more detail and learn where they can be usefully applied. Afterward, we will take a look at future alternative pattern types.
Deine entwickler.de Fullstack Experience starten
Jetzt anmelden und profitieren
So kannst du teilnehmen
Du hast bereits Fullstack?
Mit deinem Fullstack-Abo hast du Zugriff auf alle Tutorials. Logge dich ein und genieße uneingeschränkten Zugang zu all dem Content, den du für deine Weiterbildung benötigst!
Du hast noch kein Fullstack?
Fullstack-Abonnent:innen haben kostenlosen Zugriff auf das Live-Event. Zusätzlich haben Fullstack-Abonnent:innen für drei Monate Zugriff auf die Aufzeichnung des Live-Events.
198,80 € / Jahr
Für Teams mit 3-15 Nutzern
ab 358,80 € / Jahr
Preis zzgl. MwSt.
Für Teams ab 16 Nutzern
Preis zzgl. MwSt.
Alle Inhalte im Überblick
Add-ons: Bis zu 25 % Rabatt auf Konferenzen & Trainingsevents
Add-ons: Bis zu 25 % Rabatt auf Akademie Camps & FLEX Camps
Rabatte für Conferences, Training Events & Akademie Events
6 Monate Zugriff auf die Videoaufzeichnungen von deinen Conferences
Zertifikate für die Teilnahme an Conferences, Training Events & Akademie Events
Slides bei Teilnahme an Konferenzen und Akademie Events
Account Manager für alle Fragen