Previewed in Java 13 & 14, it is standardized in Java 15. Text Blocks are not a new concept, within coding languages, it can be seen in JavaScript,etc.
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.
Output
Can you indent within the text blocks?
Output
Can you use escaping within text blocks?
Output
Can you format the text blocks?
Output
Code example can be found here.
Final Thoughts
This helps in writing better, readable code.
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 😉