{"id":3737,"date":"2025-12-23T10:00:05","date_gmt":"2025-12-23T15:00:05","guid":{"rendered":"https:\/\/www.mymiller.name\/wordpress\/?p=3737"},"modified":"2025-12-23T10:00:05","modified_gmt":"2025-12-23T15:00:05","slug":"java-23-is-here-exploring-the-full-release-and-incubator-features","status":"publish","type":"post","link":"https:\/\/www.mymiller.name\/wordpress\/java_new_features\/java-23-is-here-exploring-the-full-release-and-incubator-features\/","title":{"rendered":"Java 23 is Here: Exploring the Full Release and Incubator Features"},"content":{"rendered":"\n<div class=\"wp-block-jetpack-markdown\"><p>Java 23 arrived in September 2023 with a range of new features and improvements. While it may not be a Long-Term Support (LTS) release, it offers some exciting additions worth exploring. In this blog post, we\u2019ll dive into the full release features of Java 23, providing clear explanations and practical examples, and then take a look at the incubator feature.<\/p>\n<h3>Full Release Features<\/h3>\n<h4>1. Simplified Module Imports (JEP 476)<\/h4>\n<p>Tired of importing individual classes from a module? Java 23 simplifies this process with <strong>Module Import Declarations<\/strong>. Now, you can import all public top-level classes and interfaces from a module with a single statement.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"language-java\">import module java.util; \/\/ Imports all public classes from java.util\n\npublic class ModuleImportExample {\n    public static void main(String[] args) {\n        List&lt;String&gt; names = new ArrayList&lt;&gt;();\n        names.add(&quot;Alice&quot;);\n        names.add(&quot;Bob&quot;);\n\n        System.out.println(names);\n    }\n}\n<\/code><\/pre>\n<p>This feature reduces verbosity and makes your code cleaner, especially when working with large modules.<\/p>\n<h4>2. Flexible Constructor Bodies (JEP 465)<\/h4>\n<p>Java 23 introduces more flexibility in how you write constructors. Previously, any statements within a constructor had to appear after the <code>this()<\/code> or <code>super()<\/code> call. Now, you can include statements before these calls, as long as they don\u2019t reference the instance being created.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"language-java\">public class FlexibleConstructorExample {\n    private final String name;\n\n    public FlexibleConstructorExample(String name) {\n        System.out.println(&quot;Initializing...&quot;); \/\/ Allowed before this()\n        this.name = name;\n    }\n\n    public static void main(String[] args) {\n        new FlexibleConstructorExample(&quot;John Doe&quot;);\n    }\n}\n<\/code><\/pre>\n<p>This allows for more natural placement of logic within constructors and reduces the need for auxiliary methods or complex constructor chaining.<\/p>\n<h4>3. Generational ZGC (JEP 481)<\/h4>\n<p>Garbage collection gets a performance boost in Java 23 with <strong>Generational ZGC<\/strong>. This enhancement introduces generational collection to the Z Garbage Collector, improving application throughput and reducing memory footprint. By separating objects into young and old generations, ZGC can perform more frequent garbage collection on the young generation, where most objects die quickly, leading to better performance.<\/p>\n<p>This feature is enabled by default, so you can benefit from it without any code changes.<\/p>\n<h3>Incubator Feature<\/h3>\n<h4>4. Foreign Function &amp; Memory API (JEP 483)<\/h4>\n<p>The <strong>Foreign Function &amp; Memory API<\/strong> (FFM API) allows Java programs to interact with code and data outside the Java runtime. This means you can call native libraries (like C libraries) and access native memory without the fragility and dangers of JNI.<\/p>\n<p>This is still an incubator feature, meaning it\u2019s not finalized and may change in future releases. However, it offers a powerful way to integrate Java with other systems.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre><code class=\"language-java\">import jdk.incubator.foreign.*;\n\npublic class NativeCallExample {\n    public static void main(String[] args) throws Throwable {\n        \/\/ Load the C library\n        LibraryLookup libc = LibraryLookup.ofDefault();\n        MethodHandle strlen = libc.lookup(&quot;strlen&quot;).get(FunctionDescriptor.of(long.class, ValueLayout.ADDRESS));\n\n        \/\/ Allocate off-heap memory and write a string to it\n        MemorySegment str = MemorySegment.allocateNative(CLinker.toCString(&quot;Hello, FFM!&quot;));\n\n        \/\/ Call the strlen function from the C library\n        long len = (long) strlen.invokeExact(str);\n\n        System.out.println(&quot;Length of string: &quot; + len);\n    }\n}\n<\/code><\/pre>\n<p>This example demonstrates how to use the FFM API to call the <code>strlen<\/code> function from the C standard library.<\/p>\n<p><strong>In Summary<\/strong><\/p>\n<p>Java 23 brings valuable features that enhance developer productivity and application performance. Simplified module imports reduce code verbosity, flexible constructor bodies offer more coding freedom, generational ZGC boosts garbage collection efficiency, and the FFM API provides powerful integration with native code. Be sure to explore these features and leverage them in your Java projects.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":3738,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[458],"tags":[69],"series":[],"class_list":["post-3737","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java_new_features","tag-java-2"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/immune-defense-1359197_1280-jpg.avif","jetpack-related-posts":[{"id":3912,"url":"https:\/\/www.mymiller.name\/wordpress\/uncategorized\/spring-boot-4-0-whats-next-for-the-modern-java-architect\/","url_meta":{"origin":3737,"position":0},"title":"Spring Boot 4.0: What&#8217;s Next for the Modern Java Architect?","author":"Jeffery Miller","date":"September 24, 2025","format":false,"excerpt":"A Forward-Looking Comparison of Spring Boot 3.x and 4.0 Staying on top of the rapidly evolving Java ecosystem is paramount for any software architect. The shift from Spring Boot 2.x to 3.x brought significant changes, notably the move to Jakarta EE. Now, with the horizon of Spring Boot 4.0 and\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/09\/per-2056740_1280.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/09\/per-2056740_1280.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/09\/per-2056740_1280.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/09\/per-2056740_1280.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2025\/09\/per-2056740_1280.avif 3x"},"classes":[]},{"id":1088,"url":"https:\/\/www.mymiller.name\/wordpress\/sametime\/new-java-security-baseline-means-sametime\/","url_meta":{"origin":3737,"position":1},"title":"New Java Security Baseline and what it means to Sametime","author":"Jeffery Miller","date":"April 23, 2014","format":false,"excerpt":"On April 15, 2014 Oracle has released Java 7 Update 55, with this update the security baseline was moved to Java 7 Update 55. \u00a0For Sametime users this means when they download a Java applet they will be prompted with a security dialog. \u00a0To resolve this issue Sametime users will\u2026","rel":"","context":"In &quot;Sametime&quot;","block_context":{"text":"Sametime","link":"https:\/\/www.mymiller.name\/wordpress\/category\/sametime\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2014\/02\/docview.gif?fit=502%2C316&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3740,"url":"https:\/\/www.mymiller.name\/wordpress\/springboot\/threading-in-spring-a-comprehensive-guide\/","url_meta":{"origin":3737,"position":2},"title":"Threading in Spring: A Comprehensive Guide","author":"Jeffery Miller","date":"December 23, 2025","format":false,"excerpt":"Threading is a crucial aspect of building modern, high-performance applications. It allows you to execute multiple tasks concurrently, improving responsiveness and utilizing system resources effectively. Spring Framework provides robust support for managing and using threads, simplifying development and ensuring efficiency. This article explores thread usage in Spring, delves into different\u2026","rel":"","context":"In &quot;Springboot&quot;","block_context":{"text":"Springboot","link":"https:\/\/www.mymiller.name\/wordpress\/category\/springboot\/"},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/ai-generated-8248619_1280-jpg.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/ai-generated-8248619_1280-jpg.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/ai-generated-8248619_1280-jpg.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/ai-generated-8248619_1280-jpg.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/10\/ai-generated-8248619_1280-jpg.avif 3x"},"classes":[]},{"id":3179,"url":"https:\/\/www.mymiller.name\/wordpress\/java_extra\/understanding-json-data-processing-with-java-exploring-the-jsonfieldprocessor-class\/","url_meta":{"origin":3737,"position":3},"title":"Understanding JSON Data Processing with Java: Exploring the JsonFieldProcessor Class","author":"Jeffery Miller","date":"January 15, 2026","format":false,"excerpt":"In today's digital era, data comes in various formats, with JSON (JavaScript Object Notation) being one of the most popular for representing structured data. Manipulating and processing JSON data efficiently is crucial for many software applications, from web development to data analysis. In this article, we'll delve into the workings\u2026","rel":"","context":"In &quot;Java Extras&quot;","block_context":{"text":"Java Extras","link":"https:\/\/www.mymiller.name\/wordpress\/category\/java_extra\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/04\/data-7798787_640.png?fit=640%2C640&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/04\/data-7798787_640.png?fit=640%2C640&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/04\/data-7798787_640.png?fit=640%2C640&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3357,"url":"https:\/\/www.mymiller.name\/wordpress\/java_new_features\/nullpointerexcepiton-enhancements\/","url_meta":{"origin":3737,"position":4},"title":"NullPointerExcepiton enhancements","author":"Jeffery Miller","date":"December 24, 2025","format":false,"excerpt":"The NullPointerException is a common exception in Java that occurs when a null reference is dereferenced. This exception can make debugging difficult, as it does not provide any information about which variable was null, making it harder to pinpoint the cause of the issue. However, starting from Java 14, a\u2026","rel":"","context":"In &quot;Java New Features&quot;","block_context":{"text":"Java New Features","link":"https:\/\/www.mymiller.name\/wordpress\/category\/java_new_features\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2023\/06\/paper-g580d50d6b_640-1.jpg?fit=640%2C453&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2023\/06\/paper-g580d50d6b_640-1.jpg?fit=640%2C453&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2023\/06\/paper-g580d50d6b_640-1.jpg?fit=640%2C453&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3600,"url":"https:\/\/www.mymiller.name\/wordpress\/java_new_features\/record-patterns-in-java-21-simplifying-data-extraction\/","url_meta":{"origin":3737,"position":5},"title":"Record Patterns in Java 21: Simplifying Data Extraction","author":"Jeffery Miller","date":"December 24, 2025","format":false,"excerpt":"Java 21 introduces record patterns, a powerful addition to the pattern matching arsenal. This feature streamlines the extraction of components from record classes, making code more concise and readable. What are Record Patterns? Record patterns leverage the structure of record classes to deconstruct them into their constituent parts. By specifying\u2026","rel":"","context":"In &quot;Java New Features&quot;","block_context":{"text":"Java New Features","link":"https:\/\/www.mymiller.name\/wordpress\/category\/java_new_features\/"},"img":{"alt_text":"","src":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/07\/collector-3930337_1280-jpg.avif","width":350,"height":200,"srcset":"https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/07\/collector-3930337_1280-jpg.avif 1x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/07\/collector-3930337_1280-jpg.avif 1.5x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/07\/collector-3930337_1280-jpg.avif 2x, https:\/\/www.mymiller.name\/wordpress\/wp-content\/uploads\/2024\/07\/collector-3930337_1280-jpg.avif 3x"},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/3737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/comments?post=3737"}],"version-history":[{"count":1,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/3737\/revisions"}],"predecessor-version":[{"id":3739,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/posts\/3737\/revisions\/3739"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/media\/3738"}],"wp:attachment":[{"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/media?parent=3737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/categories?post=3737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/tags?post=3737"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.mymiller.name\/wordpress\/wp-json\/wp\/v2\/series?post=3737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}