Class TextBlockPreviewExamples
java.lang.Object
net.jrodolfo.java_evolution.java13.TextBlockPreviewExamples
Demonstrates text blocks as a Java 13 preview feature.
Before text blocks, multi-line strings required repeated quotes, newline escapes, concatenation, and manual indentation. That made embedded JSON, SQL, HTML, and XML harder to read.
Java 13 previewed text blocks to solve that readability problem. Text blocks became final later, in Java 15. This project compiles on JDK 25, so the example uses final syntax while documenting the Java 13 preview origin.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionUses a text block for readable multi-line JSON.Uses a text block for readable SQL.
-
Constructor Details
-
TextBlockPreviewExamples
public TextBlockPreviewExamples()
-
-
Method Details
-
jsonTextBlock
-
sqlTextBlock
-