What are text blocks?
Text blocks are still strings. Started with 3 double quotes and ended 3 double quotes.
General Q & A
What can this be used for?
You can include literal fragments of JSON, HTML, SQL, etc.
Can you indent within the text blocks?
Can you use escaping within text blocks?
Can you format the text blocks?
Code example can be found here.
This helps in writing better, readable code.
2 thoughts on “Java 15 – Text Blocks”
Pingback: Java Versions & Features - Spaghetti Code Jungle
I’d like to thank you for the efforts you have put in penning this blog. I really hope to see the same high-grade content from you later on as well. In truth, your creative writing abilities has motivated me to get my own, personal blog now 😉