{"id":7813,"date":"2023-08-10T13:45:26","date_gmt":"2023-08-10T08:15:26","guid":{"rendered":"https:\/\/innovationm.co\/?p=7813"},"modified":"2023-08-10T13:45:26","modified_gmt":"2023-08-10T08:15:26","slug":"java-17-feature","status":"publish","type":"post","link":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/","title":{"rendered":"Java 17 feature"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Java 17 was released in September 2021 and it comes with several new features and improvements. In this blog, we will take a closer look at some of the most notable features of Java 17.\u00a0<\/span><\/p>\n<p><b>Sealed Classes (JEP 409)\u00a0<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Sealed classes are a new type of class introduced in Java 17. They provide more control over inheritance by restricting the number of subclasses that can extend a class. Sealed classes help to prevent unauthorized extensions of a class and make code more secure and maintainable.\u00a0<\/span><\/p>\n<p><b>CODE SNIPPET\u2014\u00a0<\/b><\/p>\n<pre><span style=\"font-weight: 400;\">public sealed class Shape permits Circle, Square {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">protected double area;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public double getArea() {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">return area;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">final class Circle extends Shape {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">private final double radius;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public Circle(double radius) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">this.radius = radius;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">area = Math.PI * radius * radius;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public double getRadius() {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">return radius;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">final class Square extends Shape {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">private final double side;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public Square(double side) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">this.side = side;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">area = side * side;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public double getSide() {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">return side;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public class Main {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public static void main(String[] args) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Shape circle = new Circle(5);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Circle area: \" + circle.getArea());\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Circle radius: \" + ((Circle) circle).getRadius());\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Shape square = new Square(4);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Square area: \" + square.getArea());\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Square side: \" + ((Square) square).getSide());\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<b>Pattern Matching for switch (JEP 406)\u00a0<\/b><\/pre>\n<p><span style=\"font-weight: 400;\">Java 17 introduces pattern matching for switch statements. This allows developers to match and extract values from patterns in switch expressions. It simplifies code and reduces the need for additional conditional statements.\u00a0<\/span><\/p>\n<p><b>CODE SNIPPET\u2014\u00a0<\/b><\/p>\n<pre><span style=\"font-weight: 400;\">public class Main {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public static void main(String[] args) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Object obj = \"Hello, World!\";\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">int result = switch (obj) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">case String s &amp;&amp; s.length() &gt; 10 -&gt; {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"String is longer than 10 characters\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">yield s.length();\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">case String s -&gt; {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"String is shorter than or equal to 10 characters\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">yield s.length();\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">case Integer i -&gt; {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Object is an integer\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">yield i;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">default -&gt; {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Object is of an unknown type\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">yield -1;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}<\/span>\r\n\r\n<span style=\"font-weight: 400;\">};\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Result: \" + result);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span><\/pre>\n<p><b>Enhanced Pseudo-Random Number Generators (JEP 356)\u00a0<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Java 17 enhances the existing pseudo-random number generators by introducing three new algorithms: LXM, PCG, and XoShiRo. These new algorithms are faster and provide better-quality random numbers.\u00a0<\/span><\/p>\n<p><b>CODE SNIPPET\u2014\u00a0<\/b><\/p>\n<pre><span style=\"font-weight: 400;\">import java.security.SecureRandom;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public class Main {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public static void main(String[] args) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">SecureRandom secureRandom = new SecureRandom();\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">byte[] randomBytes = new byte[16];\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Generating random bytes using the default algorithm\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">secureRandom.nextBytes(randomBytes);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Random bytes generated using the default algorithm:\"); for (byte b : randomBytes) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.print(b + \" \");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"\\n\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Generating random bytes using SHA-512\/256 algorithm\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">secureRandom = SecureRandom.getInstance(\"SHA512\/256PRNG\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">secureRandom.nextBytes(randomBytes);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Random bytes generated using the SHA-512\/256 algorithm:\"); for (byte b : randomBytes) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.print(b + \" \");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"\\n\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Generating random bytes using SHA3-224 algorithm\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">secureRandom = SecureRandom.getInstance(\"SHA3-224PRNG\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">secureRandom.nextBytes(randomBytes);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Random bytes generated using the SHA3-224 algorithm:\");<\/span>\r\n\r\n<span style=\"font-weight: 400;\">for (byte b : randomBytes) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.print(b + \" \");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"\\n\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Generating random bytes using SHA3-256 algorithm\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">secureRandom = SecureRandom.getInstance(\"SHA3-256PRNG\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">secureRandom.nextBytes(randomBytes);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Random bytes generated using the SHA3-256 algorithm:\"); for (byte b : randomBytes) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.print(b + \" \");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"\\n\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Generating random bytes using SHA3-384 algorithm\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">secureRandom = SecureRandom.getInstance(\"SHA3-384PRNG\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">secureRandom.nextBytes(randomBytes);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Random bytes generated using the SHA3-384 algorithm:\"); for (byte b : randomBytes) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.print(b + \" \");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"\\n\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span><\/pre>\n<p><b>Strongly Encapsulate JDK Internals by Default (JEP 403)\u00a0<\/b><\/p>\n<p><span style=\"font-weight: 400;\">In Java 17, JDK internals are now strongly encapsulated by default. This means that only internal APIs that are explicitly exported are accessible. This enhances the security of Java applications and makes them less vulnerable to external attacks.\u00a0<\/span><\/p>\n<p><b>CODE SNIPPET\u2014\u00a0<\/b><\/p>\n<pre><span style=\"font-weight: 400;\">public class Main {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public static void main(String[] args) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe(); \/\/ Compilation error\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Uncomment the following line to access the Unsafe class using the --illegal-access command-line option\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ System.setProperty(\"illegal-access\", \"permit\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Uncomment the following line to access the Unsafe class using the\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">jdk.unsupported.allow.restricted.packages system property\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ System.setProperty(\"jdk.unsupported.allow.restricted.packages\", \"true\");<\/span>\r\n\r\n<span style=\"font-weight: 400;\">int size = unsafe.addressSize();\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"Address size: \" + size);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span><\/pre>\n<p><b>Improved UTF-8 support (JEP 400)\u00a0<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Java 17 improves the performance of the UTF-8 encoding and decoding operations by making use of the recently introduced JDK 16&#8217;s implementation of UTF-8 strings.\u00a0<\/span><\/p>\n<p><b>CODE SNIPPET\u2014\u00a0<\/b><\/p>\n<pre><span style=\"font-weight: 400;\">import java.nio.charset.StandardCharsets;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">import java.util.Arrays;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public class Main {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public static void main(String[] args) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">String s = \"ABCD\";\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">byte[] bytes = s.getBytes(StandardCharsets.UTF_8);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(Arrays.toString(bytes));\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span><\/pre>\n<p><b>Deprecate the Applet API for Removal (JEP 398)\u00a0<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The Applet API has been deprecated in Java 17 and will be removed in a future release. This is due to security concerns and the decreasing usage of the Applet API.\u00a0<\/span><\/p>\n<p><b>CODE SNIPPET\u2014\u00a0<\/b><\/p>\n<pre><span style=\"font-weight: 400;\">import java.applet.Applet;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public class Main {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public static void main(String[] args) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Create a new instance of the deprecated Applet class\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Applet applet = new Applet();\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(applet);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><b>Foreign Function and Memory API (Incubator) (JEP 389)\u00a0<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The Foreign Function and Memory API (Incubator) provides a way to call native code from Java and access native memory. It is still in the incubator phase and is not recommended for use in production environments.\u00a0<\/span><\/p>\n<p><b>CODE SNIPPET\u2014\u00a0<\/b><\/p>\n<pre><span style=\"font-weight: 400;\">import jdk.incubator.foreign.*;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">import static jdk.incubator.foreign.CLinker.*;\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public class ExampleProgram {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">public static void main(String[] args) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">try (var scope = ResourceScope.newConfinedScope()) {\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Load the C library and define the function signature\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">LibraryLoader loader = LibraryLoader.ofSystem();\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">var math = loader.load(\"m\");\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">FunctionDescriptor sinDescriptor = FunctionDescriptor.of(CLinker.C_LONG_DOUBLE, CLinker.C_LONG_DOUBLE);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Get a function pointer for the sin() function\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">var sinFn = math.lookup(\"sin\").get().address();\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Allocate a buffer to hold the argument and result\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">var buf = scope.allocate(C_LONG_DOUBLE, 1);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Set the argument value\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">buf.setDouble(0, Math.PI \/ 2);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Call the sin() function and print the result\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">var result = sinFn.invoke(C_LONG_DOUBLE, buf);\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">System.out.println(\"sin(\u03c0\/2) = \" + result.getDouble(0));\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">}<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">In conclusion, Java 17 introduces several new features and improvements that make the development of Java applications more efficient, secure, and maintainable. Sealed classes and pattern matching for switches are two significant additions that will help developers to write cleaner and more secure code. Other features such as enhanced pseudo-random number generators, improved UTF-8 support, and strongly encapsulated JDK internals by default further enhance the functionality and security of Java applications.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java 17 was released in September 2021 and it comes with several new features and improvements. In this blog, we will take a closer look at some of the most notable features of Java 17.\u00a0 Sealed Classes (JEP 409)\u00a0 Sealed classes are a new type of class introduced in Java 17. They provide more control [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7814,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[256,360],"tags":[723,751,896,897,898],"class_list":["post-7813","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-application","category-javascript","tag-blogging","tag-blogs","tag-java-17","tag-java-17-features","tag-java-updates"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java 17 feature - InnovationM - Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.innovationm.com\/blog\/java-17-feature\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java 17 feature - InnovationM - Blog\" \/>\n<meta property=\"og:description\" content=\"Java 17 was released in September 2021 and it comes with several new features and improvements. In this blog, we will take a closer look at some of the most notable features of Java 17.\u00a0 Sealed Classes (JEP 409)\u00a0 Sealed classes are a new type of class introduced in Java 17. They provide more control [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.innovationm.com\/blog\/java-17-feature\/\" \/>\n<meta property=\"og:site_name\" content=\"InnovationM - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-10T08:15:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/08\/Java-17-feature.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1689\" \/>\n\t<meta property=\"og:image:height\" content=\"950\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InnovationM Admin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InnovationM Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/\"},\"author\":{\"name\":\"InnovationM Admin\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"headline\":\"Java 17 feature\",\"datePublished\":\"2023-08-10T08:15:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/\"},\"wordCount\":380,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Java-17-feature.png\",\"keywords\":[\"blogging\",\"blogs\",\"java 17\",\"java 17 features\",\"java updates\"],\"articleSection\":[\"Java Application\",\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/\",\"name\":\"Java 17 feature - InnovationM - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Java-17-feature.png\",\"datePublished\":\"2023-08-10T08:15:26+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Java-17-feature.png\",\"contentUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Java-17-feature.png\",\"width\":1689,\"height\":950},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/java-17-feature\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java 17 feature\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\",\"name\":\"InnovationM - Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\",\"name\":\"InnovationM Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"caption\":\"InnovationM Admin\"},\"sameAs\":[\"http:\\\/\\\/www.innovationm.com\\\/\"],\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/author\\\/innovationmadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java 17 feature - InnovationM - Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/","og_locale":"en_US","og_type":"article","og_title":"Java 17 feature - InnovationM - Blog","og_description":"Java 17 was released in September 2021 and it comes with several new features and improvements. In this blog, we will take a closer look at some of the most notable features of Java 17.\u00a0 Sealed Classes (JEP 409)\u00a0 Sealed classes are a new type of class introduced in Java 17. They provide more control [&hellip;]","og_url":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/","og_site_name":"InnovationM - Blog","article_published_time":"2023-08-10T08:15:26+00:00","og_image":[{"width":1689,"height":950,"url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/08\/Java-17-feature.png","type":"image\/png"}],"author":"InnovationM Admin","twitter_misc":{"Written by":"InnovationM Admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/#article","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/"},"author":{"name":"InnovationM Admin","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"headline":"Java 17 feature","datePublished":"2023-08-10T08:15:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/"},"wordCount":380,"commentCount":0,"image":{"@id":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/08\/Java-17-feature.png","keywords":["blogging","blogs","java 17","java 17 features","java updates"],"articleSection":["Java Application","JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.innovationm.com\/blog\/java-17-feature\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/","url":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/","name":"Java 17 feature - InnovationM - Blog","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/#primaryimage"},"image":{"@id":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/08\/Java-17-feature.png","datePublished":"2023-08-10T08:15:26+00:00","author":{"@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"breadcrumb":{"@id":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.innovationm.com\/blog\/java-17-feature\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/#primaryimage","url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/08\/Java-17-feature.png","contentUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/08\/Java-17-feature.png","width":1689,"height":950},{"@type":"BreadcrumbList","@id":"https:\/\/www.innovationm.com\/blog\/java-17-feature\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.innovationm.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Java 17 feature"}]},{"@type":"WebSite","@id":"https:\/\/www.innovationm.com\/blog\/#website","url":"https:\/\/www.innovationm.com\/blog\/","name":"InnovationM - Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.innovationm.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed","name":"InnovationM Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","caption":"InnovationM Admin"},"sameAs":["http:\/\/www.innovationm.com\/"],"url":"https:\/\/www.innovationm.com\/blog\/author\/innovationmadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/7813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/comments?post=7813"}],"version-history":[{"count":0,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/7813\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media\/7814"}],"wp:attachment":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media?parent=7813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/categories?post=7813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/tags?post=7813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}