![]() ![]() Prior to text block you would write the same as shown below. With Java 13 and 14, we needed to enable it as a preview feature. Example:Īssign a JSON to a string as a text block. Note: Since Java 15, text blocks are available as a standard feature. What are text blocks ?Ī text block is a multi-line string literal that avoids the need for most escape sequences, automatically formats the string in a predictable way, and gives the developer control over the format when desired. ![]() ![]() It was a preview feature in Java 13, 14 and became final and permanent in Java 15. A text block is an alternative form of Java string representation that can be used anywhere a traditional double quoted string literal can be used. Java SE 13 (Sept 2019) introduced text blocks as a preview feature, aimed at reducing the pain of declaring and using multi-line string literals in Java. Today, Java 13 will be released.In addition to otherwise rather inconspicuous innovations, the release extends the language by multi-line string literals, in Java’s jargon text blocks or text blocks, which were introduced with JEP 355. Another interesting feature that was added to Java is the text blocks. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |