© Kishori Sharan 2019
K. SharanJava 13 Revealedhttps://doi.org/10.1007/978-1-4842-5407-3_6

6. Text Blocks

Kishori Sharan1 
(1)
Montgomery, AL, USA
 
In this chapter, you will learn
  • What text blocks are

  • How to represent text blocks in your code

  • The formatting rules for text blocks

  • Changes to the String API to support text blocks

  • How to detect inconsistent use of whitespaces in text blocks

The Background

Rarely you write a Java program without dealing with strings. Java supports strings as instances of the String class since version 1.0. It also supports String literals, which are sequences of zero or more characters enclosed in double quotes. String literals are represented in the source code, and they are instances of the String class. The biggest pain points ...

Get Java 13 Revealed: For Early Adoption and Migration now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.