PrepZone Logo
PrepZone
Back to Java

Java · Easy

What are Text Blocks (Java 15)? How do they handle indentation and escape sequences?

JavaJava 17+

Answer preview

Text blocks (Java 15) are multi-line string literals delimited by """. They preserve formatting, reduce escaping, and are ideal for SQL, JSON, HTML, and test fixtures.…