> Markdown version of [/videos/1202-modern-java](https://www.wearedevelopers.com/videos/1202-modern-java). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Modern Java Java 22 and 23 completely redefine the developer experience. With Project Loom's virtual threads and zero-boilerplate execution, building massively scalable applications is easier than ever. - **Speakers:** [Ron Veen](https://www.wearedevelopers.com/@ron-veen) - **Event:** World Congress 2024 - **Published:** August 29, 2024 - **Duration:** 30:21 - **URL:** https://www.wearedevelopers.com/videos/1202-modern-java ## Summary The presentation explores the evolution of Modern Java, focusing on features introduced in Java 22 and the forthcoming Java 23 that make the language faster, more scalable, and significantly easier to learn. A major theme is the paradigm shift brought by Project Loom, emphasizing the massive scalability of virtual threads alongside structured concurrency and scoped values to manage complex thread lifecycles efficiently without the bloat of traditional thread-local variables. Significant advancements in language syntax streamline daily developer workflows. Pattern matching has expanded dramatically, supporting elegant record deconstruction, unnamed variables via underscore syntax, and primitive types. Similarly, the Collections API enhances usability with sequenced collections, while stream gatherers introduce groundbreaking flexibility by enabling custom intermediate stream operations with specific lifecycle callbacks. The ecosystem is also prioritizing developer experience by lowering the barrier to entry for beginners and those coming from scripting languages. By eliminating initial boilerplate through unnamed classes, instance main methods, and implicit module imports, Java now allows multi-file source code execution without an explicit compilation step. Combined with high-performance improvements like the generational zero-garbage collector and modernized Markdown documentation, these updates position Java as a highly approachable yet profoundly capable programming language. **Keywords:** virtual threads, project loom, structured concurrency, scoped values, pattern matching, record deconstruction, unnamed variables, sequenced collections, stream gatherers, zero-garbage collector, unnamed classes, instance main method, module imports, multi-file source code execution, markdown documentation ## Chapters 1. **Virtual threads for massive application scalability** (00:48) — JVM-managed virtual threads enable efficient IO operations and massive task scaling. 1. **Managing thread hierarchies with structured concurrency** (03:14) — Task scopes encapsulate subthreads to automatically manage memory and handle runtime failures. 1. **Replacing thread-local variables with scoped values** (06:18) — Immutable scoped values provide a safer and lighter alternative for sharing sensitive data across threads. 1. **Record patterns and data type pattern matching** (08:23) — Pattern matching allows decision-making based on variable types and fast implicit record deconstruction. 1. **Uncluttering code with unnamed patterns and variables** (11:33) — The underscore symbol suppresses unused variables in loops, exception handling, and variable assignment. 1. **Applying pattern matching to primitive data types** (13:36) — Primitive types natively integrate into pattern matching constructs alongside objects and standard records. 1. **Simplifying element access using sequenced collections** (15:04) — Dedicated methods easily retrieve the first, last, or reversed elements of standard list structures. 1. **Allowing standard statements before constructor super calls** (16:36) — Child classes can execute calculations and distinct logic prior to passing mapped values up to parent configurations. 1. **Creating custom intermediate operations using stream gatherers** (18:22) — Stream gatherers define distinct callback functions enabling developers to build proprietary stream processing stages. 1. **Reducing latency with the generational zero garbage collector** (22:50) — Generational garbage collection runs concurrently to prevent global application freezing during active system execution. 1. **Simplifying application execution with instance main methods** (24:12) — Omitting bulky class declarations and static public keywords speeds up learning and rapidly executes runtime environments. 1. **Importing large codebase packages using module imports** (26:54) — A single module import implicitly loads logically required classes on demand without resulting in excessive wildcard usage. 1. **Running multi-file source code programs without compilation** (28:20) — The JVM instantly reads scripts sequentially referencing multiple local files without requiring any extensive external build frameworks. 1. **Documenting application properties using markdown formatting** (29:36) — Markdown syntax cleanly renders readable documentation natively inside blocks populated by structured lists and headers. ## Related Moments - [Significant performance and language features launching in Java 21](https://www.wearedevelopers.com/videos/658-beam-me-up-java-unraveling-the-warp-speed-evolution-a-journey-through-java-lts-versions-11-to-21) (from "Beam Me Up, Java! Unraveling the Warp-Speed Evolution: A Journey through Java LTS Versions 11 to 21") - [Goals and concepts behind Java Project Loom](https://www.wearedevelopers.com/videos/993-java-s-project-loom-co-the-end-for-reactive-programming) (from "Java's Project Loom & Co - the end for reactive programming?") - [Introduction to Loom and its impact on concurrency](https://www.wearedevelopers.com/videos/1973-beyond-loom-practical-patterns-for-virtual-threads-structured-concurrency-and-reactive-interop) (from "Beyond Loom: Practical Patterns for Virtual Threads, Structured Concurrency and Reactive Interop") - [Overview of the Java features presentation](https://www.wearedevelopers.com/videos/105-best-of-java-15-and-beyond-my-favorite-features) (from "Best of Java 15 and beyond—my favorite features") - [Audience Q&A on developer advocacy and Java trends](https://www.wearedevelopers.com/videos/537-bootiful-spring-boot-3) (from "Bootiful Spring Boot 3") - [Key takeaways for adopting virtual threads in Java](https://www.wearedevelopers.com/videos/843-java-21-the-revolution-of-virtual-threads-a-deep-dive) (from "Java 21: The Revolution of Virtual Threads - A Deep Dive") ## Related Articles - [Using Java 17 latest features in real world projects](https://www.wearedevelopers.com/magazine/121-using-java-17-latest-features-in-real-world-projects) - [Java Basics](https://www.wearedevelopers.com/magazine/122-java-basics) - [Modern Java Records](https://www.wearedevelopers.com/magazine/41-modern-java-records) - [Top 10 Java Libraries](https://www.wearedevelopers.com/magazine/364-top-10-java-libraries) ## Related Jobs - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/15942-senior-software-engineer) at **GitHub** - [Senior Software Engineer (L3)](https://www.wearedevelopers.com/jobs/ext/1956800-senior-software-engineer-l3) at **Twilio** - [Principal Software Engineer](https://www.wearedevelopers.com/jobs/ext/149130-principal-software-engineer) at **Twilio** - [Software Engineer L3](https://www.wearedevelopers.com/jobs/ext/1840587-software-engineer-l3) at **Twilio** - [Software Engineer (L2) Segment Team](https://www.wearedevelopers.com/jobs/ext/238794-software-engineer-l2-segment-team) at **Twilio** - [Senior Software Engineer, Client Apps Platform](https://www.wearedevelopers.com/jobs/ext/1773893-senior-software-engineer-client-apps-platform) at **GitHub**