TAG · 1 ARTICLE

#text-blocks

  1. JAVAJava text blocks explained: multiline strings in JavaText blocks let you write JSON, SQL, HTML and LLM prompts in Java exactly as they look, without escaped quotes or \n on every line. Here is the syntax, how Java decides what indentation to keep, the two escapes worth knowing, and how to fill in values.16 Nov 2026 · 5 min