{"id":4958,"date":"2020-07-26T04:49:58","date_gmt":"2020-07-26T04:49:58","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=4958"},"modified":"2024-08-09T06:17:02","modified_gmt":"2024-08-09T06:17:02","slug":"what-are-the-new-features-in-jdk15","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/what-are-the-new-features-in-jdk15\/","title":{"rendered":"What are the new features in JDK15"},"content":{"rendered":"<h2>What are the new features in JDK15<\/h2>\n<p>Some of the interesting new features in JDK15 are as follows:<\/p>\n<p>Sealed Class<br \/>\nSealed Interfaces<br \/>\nText Blocks<br \/>\nRecords<br \/>\nHidden Classes<\/p>\n<h3>Sealed Class<\/h3>\n<p><strong><a href=\"https:\/\/www.testingdocs.com\/questions\/what-are-sealed-classes-in-java\/\">https:\/\/www.testingdocs.com\/questions\/what-are-sealed-classes-in-java\/<\/a><\/strong><\/p>\n<h3>Sealed Interface<\/h3>\n<p><strong><a href=\"https:\/\/www.testingdocs.com\/questions\/what-is-a-sealed-interface-in-java\/\">https:\/\/www.testingdocs.com\/questions\/what-is-a-sealed-interface-in-java\/<\/a><\/strong><\/p>\n<h3>Text Blocks<\/h3>\n<p>Textblocks are designed to support multi-line strings in the Java code. Text block begins with three double quotes and newline.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package jdk15;\r\n\/\/www.TestingDocs.com\r\npublic class TextBlockDemo {\r\n    public static void main(String... args) {\r\n        \/\/text block begins with three double quotes and newline\r\n        String str = \"\"\"\r\n    Hello\r\n    Text\r\n    Blocks\r\n        \"\"\";\r\n        System.out.println(str);\r\n        String helloStr = \"\"\"Hello World \"\"\"; \/\/ERROR\r\n        String helloStr1 = \"\"\"Hello\r\n                                World \r\n                                \"\"\"; \/\/ERROR\r\n\r\n    }\r\n}\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What are the new features in JDK15 Some of the interesting new features in JDK15 are as follows: Sealed Class Sealed Interfaces Text Blocks Records Hidden Classes Sealed Class https:\/\/www.testingdocs.com\/questions\/what-are-sealed-classes-in-java\/ Sealed Interface https:\/\/www.testingdocs.com\/questions\/what-is-a-sealed-interface-in-java\/ Text Blocks Textblocks are designed to support multi-line strings in the Java code. Text block begins with three double quotes and newline. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"class_list":["post-4958","post","type-post","status-publish","format-standard","hentry","category-java","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4958","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=4958"}],"version-history":[{"count":6,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4958\/revisions"}],"predecessor-version":[{"id":23647,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/4958\/revisions\/23647"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=4958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=4958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=4958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}