<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sealed Classes on foojay.io - Friends of OpenJDK</title><link>https://foojayio.github.io/website/today/category/sealed-classes/</link><description>Recent content in Sealed Classes on foojay.io - Friends of OpenJDK</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 26 Nov 2025 11:05:08 +0000</lastBuildDate><atom:link href="https://foojayio.github.io/website/today/category/sealed-classes/index.xml" rel="self" type="application/rss+xml"/><item><title>The Visitor Pattern - 'Revisited' using Data Oriented Programming techniques</title><link>https://foojayio.github.io/website/today/the-visitor-pattern-revisited-using-data-oriented-programming-techniques/</link><pubDate>Wed, 26 Nov 2025 10:38:43 +0000</pubDate><guid>https://foojayio.github.io/website/today/the-visitor-pattern-revisited-using-data-oriented-programming-techniques/</guid><description>&lt;h2 id="h2-0-introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Design patterns are great, they standardize solutions for common programming problems so you don&amp;rsquo;t shoot yourself in the foot or reinvent the wheel.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;However, some might argue that some design patterns only exist in a programming language because that language lacks a way to elegantly and efficiently express it in its syntax.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For example, the &lt;a href="https://en.wikipedia.org/wiki/Strategy_pattern" target="_blank" rel="noopener noreferrer"&gt;Strategy pattern&lt;/a&gt;
 is a design pattern that enables selecting algorithms at runtime. Taking the example of different &lt;em&gt;strategies&lt;/em&gt; of tax calculation, let&amp;rsquo;s see what an implementation looked like &lt;em&gt;before&lt;/em&gt; java 8:&lt;/p&gt;</description></item><item><title>Java 21 Is Available Today, And It's Quite The Update</title><link>https://foojayio.github.io/website/today/java-21-is-available-today-and-its-quite-the-update/</link><pubDate>Tue, 19 Sep 2023 05:31:13 +0000</pubDate><guid>https://foojayio.github.io/website/today/java-21-is-available-today-and-its-quite-the-update/</guid><description>&lt;p&gt;&lt;strong&gt;Today&amp;rsquo;s the first day of Java 21&amp;rsquo;s availability! It&amp;rsquo;s been six months since Java 20 was released, so it&amp;rsquo;s time for another fresh wave of Java features. This post takes you on a tour of the JEPs that are associated with this release and it gives you a brief introduction to each of them, and &lt;a href="https://foojayio.github.io/website/today/foojay-podcast-28/"&gt;check out the Java 21 podcast here&lt;/a&gt;
. Where applicable the differences with Java 20 are highlighted and a few typical use cases are provided, so that you&amp;rsquo;ll be more than ready to use these features after reading this!&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Rolling Binary Trees: A Guide to Common Design Patterns in Java</title><link>https://foojayio.github.io/website/today/rolling-binary-trees-a-guide-to-common-design-patterns-in-java/</link><pubDate>Wed, 24 May 2023 12:55:14 +0000</pubDate><guid>https://foojayio.github.io/website/today/rolling-binary-trees-a-guide-to-common-design-patterns-in-java/</guid><description>&lt;h2 id="h2-0-introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Binary trees are fundamental data structures, ubiquitous in computer science and software engineering. We use them to represent hierarchical data and implement more complex data structures, such as search trees, syntax trees, cryptographic hash trees, space partitioning trees, heaps, and so on. Common binary tree operations include insertion, deletion, traversal, and rotation.&lt;/p&gt;
&lt;p&gt;A relatively uncommon and unexplored operation is &lt;strong&gt;roll&lt;/strong&gt; , which modifies the structure of a binary tree in such a way that, when visualized, the newly obtained structure appears to be rolled at a 90-degree angle, either clockwise or counterclockwise. This gives us two variants of the roll operation &amp;mdash; &lt;strong&gt;clockwise roll&lt;/strong&gt; (CR) and &lt;strong&gt;counterclockwise roll&lt;/strong&gt; (CCR).&lt;/p&gt;</description></item><item><title>Java Sealed Classes: Building Robust and Secure Applications</title><link>https://foojayio.github.io/website/today/java-sealed-classes-in-action-building-robust-and-secure-applications/</link><pubDate>Mon, 20 Feb 2023 11:11:07 +0000</pubDate><guid>https://foojayio.github.io/website/today/java-sealed-classes-in-action-building-robust-and-secure-applications/</guid><description>&lt;p&gt;Java sealed classes were introduced in Java 15 as a way to restrict the inheritance hierarchy of a class or interface.&lt;/p&gt;
&lt;p&gt;A sealed class or interface restricts the set of classes that can implement or extend it, which can help prevent bugs and make code more maintainable.&lt;/p&gt;
&lt;p&gt;Suppose you&amp;rsquo;re building an e-commerce application that supports different payment methods, such as credit cards, PayPal, and Bitcoin. You could define a sealed class called PaymentMethod that permits various subclasses for each payment method:&lt;/p&gt;</description></item><item><title>Foojay Podcast #5: OpenJDK Discussion Panel</title><link>https://foojayio.github.io/website/today/foojay-podcast-5/</link><pubDate>Tue, 20 Sep 2022 15:56:27 +0000</pubDate><guid>https://foojayio.github.io/website/today/foojay-podcast-5/</guid><description>&lt;p&gt;It&amp;rsquo;s September 20th, OpenJDK 19 has been released. In this podcast, we discuss the new features and the changes that this release brings.&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
			&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/71ZAYZWwpuI?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
		&lt;/div&gt;

&lt;h2 id="h2-1--odcast-pps"&gt;Podcast Apps&lt;/h2&gt;
&lt;p&gt;You can listen and subscribe to the Foojay Podcast on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://open.spotify.com/show/6CpTfgn9LirzJGAtc4ICdQ" target="_blank" rel="noopener noreferrer"&gt;Spotify&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://podcasts.apple.com/be/podcast/foojay-io-the-friends-of-openjdk/id1652281304" target="_blank" rel="noopener noreferrer"&gt;Apple Podcasts&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;And most others&amp;hellip;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="h2-1-guests"&gt;Guests&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://twitter.com/miragemiko" target="_blank" rel="noopener noreferrer"&gt;Miroslav Wengner&lt;/a&gt;
&lt;/strong&gt; (OpenValue)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://twitter.com/mgrygles" target="_blank" rel="noopener noreferrer"&gt;Mary Grygleski&lt;/a&gt;
&lt;/strong&gt; (CJUG, DataStax)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="https://twitter.com/deepu105" target="_blank" rel="noopener noreferrer"&gt;Deepu K Sasidharan&lt;/a&gt;
&lt;/strong&gt; (Okta, JHipster)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="h2-2-podcast-host"&gt;Podcast host&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://twitter.com/costlow" target="_blank" rel="noopener noreferrer"&gt;Erik Costlow&lt;/a&gt;
&lt;/strong&gt; (Azul)&lt;/p&gt;</description></item><item><title>Getting Started with Java 17 and IntelliJ IDEA</title><link>https://foojayio.github.io/website/today/getting-started-with-java-17-and-intellij-idea/</link><pubDate>Tue, 14 Sep 2021 09:20:56 +0000</pubDate><guid>https://foojayio.github.io/website/today/getting-started-with-java-17-and-intellij-idea/</guid><description>&lt;p&gt;A new Java release every six months can be exciting, overwhelming, or both. Given that &lt;a href="https://openjdk.java.net/projects/jdk/17/" target="_blank" rel="noopener noreferrer"&gt;Java 17&lt;/a&gt;
 is also an &lt;a href="https://www.oracle.com/java/technologies/java-se-support-roadmap.html" target="_blank" rel="noopener noreferrer"&gt;LTS&lt;/a&gt;
 release, it&amp;rsquo;s not just the developers but enterprises also noticing it. If you have been &lt;a href="https://www.ted.com/talks/tim_urban_inside_the_mind_of_a_master_procrastinator" target="_blank" rel="noopener noreferrer"&gt;waiting&lt;/a&gt;
 to move on from Java 8 or 11, now is the time to weigh its advantages.&lt;/p&gt;
&lt;p&gt;In this article, I will limit the coverage of Java 17 to its language features &amp;ndash; &lt;a href="https://openjdk.java.net/jeps/409" target="_blank" rel="noopener noreferrer"&gt;Sealed Classes&lt;/a&gt;
 and &lt;a href="https://openjdk.java.net/jeps/406" target="_blank" rel="noopener noreferrer"&gt;Pattern Matching for switch&lt;/a&gt;
. I&amp;rsquo;ll cover what these features are, why you might need them, and how you can start using them in &lt;a href="https://blog.jetbrains.com/idea/2021/08/intellij-idea-2021-2-1/" target="_blank" rel="noopener noreferrer"&gt;IntelliJ IDEA&lt;/a&gt;
. I will also highlight how these features can reduce the &lt;em&gt;cognitive complexity&lt;/em&gt; for developers. You can use &lt;a href="https://openjdk.java.net/projects/jdk/17/" target="_blank" rel="noopener noreferrer"&gt;this link&lt;/a&gt;
 for a comprehensive list of all the new Java 17 features.&lt;/p&gt;</description></item><item><title>Latest Java Releases and Eclipse Java IDE</title><link>https://foojayio.github.io/website/today/keeping-pace-with-java-using-eclipse-ide/</link><pubDate>Tue, 30 Mar 2021 07:51:12 +0000</pubDate><guid>https://foojayio.github.io/website/today/keeping-pace-with-java-using-eclipse-ide/</guid><description>&lt;p&gt;The Java language has been evolving at a fast pace with a six month release cadence and preview features.&lt;/p&gt;
&lt;p&gt;With faster Java releases, it&amp;rsquo;s an exciting time to be a Java developer. Every new release of Java promises interesting features and updates.&lt;/p&gt;
&lt;p&gt;To give them a spin, you have the tooling support in Eclipse Java IDE ready at your disposal.&lt;/p&gt;
&lt;h2 id="h2-0-under-the-hood"&gt;Under the Hood&lt;/h2&gt;
&lt;p&gt;The Java tooling in Eclipse IDE has its own compiler implementation which not only generates class files, but also produces a Java document model which forms the basis for implementing a large number of tooling features.&lt;/p&gt;</description></item><item><title>Highlights of the Newest and Latest JEPs in Java 16</title><link>https://foojayio.github.io/website/today/highlights-of-new-jeps-in-java-16/</link><pubDate>Tue, 16 Mar 2021 18:02:43 +0000</pubDate><guid>https://foojayio.github.io/website/today/highlights-of-new-jeps-in-java-16/</guid><description>&lt;p&gt;The JDK Enhancement Proposal (or JEP) is a community process for collecting proposals for enhancements to the OpenJDK.&lt;/p&gt;
&lt;p&gt;Java 16, released today, incorporates the JEPs below:&lt;/p&gt;
&lt;p&gt;|&amp;mdash;&amp;mdash;&amp;mdash;|&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;-|&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;&amp;mdash;-|
| &lt;strong&gt;JEP&lt;/strong&gt; | &lt;strong&gt;Name&lt;/strong&gt; | &lt;strong&gt;Summary&lt;/strong&gt; |
| 338 | &lt;a href="https://openjdk.java.net/jeps/338" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Vector API (Incubator)&lt;/strong&gt;&lt;/a&gt;
 | Provide an initial iteration of an &lt;a href="https://openjdk.java.net/jeps/11" target="_blank" rel="noopener noreferrer"&gt;incubator module&lt;/a&gt;
, &lt;code&gt;jdk.incubator.vector&lt;/code&gt;, to express vector computations that reliably compile at runtime to optimal vector hardware instructions on supported CPU architectures and thus achieve superior performance to equivalent scalar computations. |
| 347 | &lt;a href="https://openjdk.java.net/jeps/347" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Enable C++14 Language Features&lt;/strong&gt;&lt;/a&gt;
 | Allow the use of C++14 language features in JDK C++ source code, and give specific guidance about which of those features may be used in HotSpot code. |
| 357 | &lt;a href="https://openjdk.java.net/jeps/357" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Migrate from Mercurial to Git&lt;/strong&gt;&lt;/a&gt;
 | Migrate the OpenJDK Community&amp;rsquo;s source code repositories from Mercurial (hg) to Git. |
| 369 | &lt;a href="https://openjdk.java.net/jeps/369" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Migrate to GitHub&lt;/strong&gt;&lt;/a&gt;
 | Host the OpenJDK Community&amp;rsquo;s Git repositories on &lt;a href="https://www.github.com/" target="_blank" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
. In concert with &lt;a href="https://openjdk.java.net/jeps/357" target="_blank" rel="noopener noreferrer"&gt;JEP 357 (Migrate from Mercurial to Git)&lt;/a&gt;
, this would migrate all single-repository OpenJDK Projects to GitHub, including both &lt;a href="https://openjdk.java.net/projects/jdk/" target="_blank" rel="noopener noreferrer"&gt;JDK feature releases&lt;/a&gt;
 and &lt;a href="https://openjdk.java.net/projects/jdk-updates/" target="_blank" rel="noopener noreferrer"&gt;JDK update releases&lt;/a&gt;
 for versions 11 and later. |
| 376 | &lt;a href="https://openjdk.java.net/jeps/376" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Concurrent Thread-Stack Processing&lt;/strong&gt;&lt;/a&gt;
 | Move ZGC thread-stack processing from safepoints to a concurrent phase. |
| 380 | &lt;a href="https://openjdk.java.net/jeps/380" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Unix-Domain Socket Channels&lt;/strong&gt;&lt;/a&gt;
 | Add Unix-domain (&lt;code&gt;AF_UNIX&lt;/code&gt;) socket support to the &lt;a href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/nio/channels/SocketChannel.html" target="_blank" rel="noopener noreferrer"&gt;socket channel&lt;/a&gt;
 and &lt;a href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/nio/channels/ServerSocketChannel.html" target="_blank" rel="noopener noreferrer"&gt;server-socket channel&lt;/a&gt;
 APIs in the &lt;code&gt;java.nio.channels&lt;/code&gt; package. Extend the &lt;a href="https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/nio/channels/spi/SelectorProvider.html#inheritedChannel%28%29" target="_blank" rel="noopener noreferrer"&gt;inherited channel mechanism&lt;/a&gt;
 to support Unix-domain socket channels and server socket channels. |
| 386 | &lt;a href="https://openjdk.java.net/jeps/386" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Alpine Linux Port&lt;/strong&gt;&lt;/a&gt;
 | Port the JDK to Alpine Linux, and to other Linux distributions that use musl as their primary C library, on both the x64 and AArch64 architectures, |
| 387 | &lt;a href="https://openjdk.java.net/jeps/387" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Elastic Metaspace&lt;/strong&gt;&lt;/a&gt;
 | Return unused HotSpot class-metadata (i.e., &lt;em&gt;metaspace&lt;/em&gt;) memory to the operating system more promptly, reduce metaspace footprint, and simplify the metaspace code in order to reduce maintenance costs. |
| 388 | &lt;a href="https://openjdk.java.net/jeps/388" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Windows/AArch64 Port&lt;/strong&gt;&lt;/a&gt;
 | Port the JDK to Windows/AArch64. |
| 389 | &lt;a href="https://openjdk.java.net/jeps/389" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Foreign Linker API (Incubator)&lt;/strong&gt;&lt;/a&gt;
 | Introduce an API that offers statically-typed, pure-Java access to native code. This API, together with the Foreign-Memory API (&lt;a href="https://openjdk.java.net/jeps/393" target="_blank" rel="noopener noreferrer"&gt;JEP 393&lt;/a&gt;
), will considerably simplify the otherwise error-prone process of binding to a native library. |
| 390 | &lt;a href="https://openjdk.java.net/jeps/390" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Warnings for Value-Based Classes&lt;/strong&gt;&lt;/a&gt;
 | Designate the primitive wrapper classes as &lt;em&gt;value-based&lt;/em&gt; and deprecate their constructors for removal, prompting new deprecation warnings. Provide warnings about improper attempts to synchronize on instances of any value-based classes in the Java Platform. |
| 392 | &lt;a href="https://openjdk.java.net/jeps/392" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Packaging Tool&lt;/strong&gt;&lt;/a&gt;
 | Provide the &lt;code&gt;jpackage&lt;/code&gt; tool, for packaging self-contained Java applications. |
| 393 | &lt;a href="https://openjdk.java.net/jeps/393" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Foreign-Memory Access API (Third Incubator)&lt;/strong&gt;&lt;/a&gt;
 | Introduce an API to allow Java programs to safely and efficiently access foreign memory outside of the Java heap. |
| 394 | &lt;a href="https://openjdk.java.net/jeps/394" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Pattern Matching for instanceof&lt;/strong&gt;&lt;/a&gt;
 | Enhance the Java programming language with &lt;em&gt;pattern matching&lt;/em&gt; for the&lt;code&gt;instanceof&lt;/code&gt; operator. &lt;a href="https://cr.openjdk.java.net/~briangoetz/amber/pattern-match.html" target="_blank" rel="noopener noreferrer"&gt;Pattern matching&lt;/a&gt;
 allows common logic in a program, namely the conditional extraction of components from objects, to be expressed more concisely and safely. |
| 395 | &lt;a href="https://openjdk.java.net/jeps/395" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Records&lt;/strong&gt;&lt;/a&gt;
 | Enhance the Java programming language with &lt;a href="https://cr.openjdk.java.net/~briangoetz/amber/datum.html" target="_blank" rel="noopener noreferrer"&gt;records&lt;/a&gt;
, which are classes that act as transparent carriers for immutable data. Records can be thought of as &lt;em&gt;nominal tuples&lt;/em&gt;. |
| 396 | &lt;a href="https://openjdk.java.net/jeps/396" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Strongly Encapsulate JDK Internals by Default&lt;/strong&gt;&lt;/a&gt;
 | Strongly encapsulate all internal elements of the JDK by default, except for &lt;a href="https://openjdk.java.net/jeps/260#Description" target="_blank" rel="noopener noreferrer"&gt;critical internal APIs&lt;/a&gt;
 such as &lt;code&gt;sun.misc.Unsafe&lt;/code&gt;. Allow end users to choose the relaxed strong encapsulation that has been the default since JDK 9. |
| 397 | &lt;a href="https://openjdk.java.net/jeps/397" target="_blank" rel="noopener noreferrer"&gt;&lt;strong&gt;Sealed Classes (Second Preview)&lt;/strong&gt;&lt;/a&gt;
 | Enhance the Java programming language with &lt;a href="https://cr.openjdk.java.net/~briangoetz/amber/datum.html" target="_blank" rel="noopener noreferrer"&gt;sealed classes and interfaces&lt;/a&gt;
. Sealed classes and interfaces restrict which other classes or interfaces may extend or implement them. |&lt;/p&gt;</description></item><item><title>Immutable Collections in Java with Sealed Types</title><link>https://foojayio.github.io/website/today/immutable-collections-in-java-with-sealed-types/</link><pubDate>Thu, 10 Dec 2020 03:02:00 +0000</pubDate><guid>https://foojayio.github.io/website/today/immutable-collections-in-java-with-sealed-types/</guid><description>&lt;br /&gt;
&lt;img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-36538" class="size-medium wp-image-36538" src="foojay-don-1-1-469x510.png" alt="" width="469" height="510"&gt;
&lt;p&gt;&lt;em&gt;Designing Immutable Collection using Sealed Types in JDK 15&lt;/em&gt;{#caption-attachment-36538}&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt;How to define contractual, structural, and verifiable immutable Java collections.&lt;/p&gt;
&lt;h2 id="9dc0"&gt;Introducing Sealed Types&lt;/h2&gt;
&lt;p&gt;JDK 15 was released on September 15, 2020. &lt;a href="https://openjdk.java.net/jeps/360" target="_blank" rel="noopener noreferrer"&gt;JEP 360&lt;/a&gt;
Sealed Types was included as a preview feature in this release, with its second preview in JDK 16. Sealed Types is part of &lt;a href="https://openjdk.java.net/projects/amber/" target="_blank" rel="noopener noreferrer"&gt;Project Amber&lt;/a&gt;
. Sealed classes or interfaces can be used to restrict the interfaces or classes that are allowed to extend them. This is accomplished by using the &lt;code&gt;sealed&lt;/code&gt;, &lt;code&gt;non-sealed&lt;/code&gt;, and &lt;code&gt;permits&lt;/code&gt; modifiers.{#297e}&lt;/p&gt;</description></item><item><title>JDK 15 Sealed Classes: Fine-Grained Mechanism for Inheritance</title><link>https://foojayio.github.io/website/today/jdk-15-sealed-classes/</link><pubDate>Fri, 09 Oct 2020 10:43:54 +0000</pubDate><guid>https://foojayio.github.io/website/today/jdk-15-sealed-classes/</guid><description>&lt;p&gt;The most significant new preview feature in JDK 15 (with its second preview in JDK 16), and the only change to the language, is the introduction of sealed classes as a preview feature.&lt;/p&gt;
&lt;h4 id="preview-features"&gt;Preview Features&lt;/h4&gt;
&lt;p&gt;&lt;a href="https://openjdk.java.net/jeps/12" target="_blank" rel="noopener noreferrer"&gt;Preview features&lt;/a&gt;
 first appeared in JDK 12 and allowed for new functionality to be included in the JDK without adding it to the Java SE specification (this applies to the Java language, Java Virtual Machine, and Java SE APIs).&lt;/p&gt;</description></item></channel></rss>