Text Block in Java
Aug 26, 2025 · 3 min read · What is a text block?
A multi-line string literal delimited by triple quotes """ that preserves newlines and most indentation—perfect for JSON, SQL, HTML, or templates.
String json = """
{
"name": "Alice",
"age": 25
}
""";
Wh...