From the course: Migrating beyond Java 8

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Java 13 language and API features

Java 13 language and API features - Java Tutorial

From the course: Migrating beyond Java 8

Start my 1-month free trial

Java 13 language and API features

- [Instructor] The majority of changes in JAVA 13 were not language or API changes, however, this version did deliver an exciting new preview feature: TextBlocks. A TextBlock is a new type of literal that makes it easier to work with multi-line strings. In the past, multi-line strings required us to use concatenation operators and special escape sequences for quotation marks and new lines, making them difficult to read and write. With TextBlocks, we can remove this clutter from our code and it becomes easier to complete tasks involving multi-line strings such as when we word with JSON. So let's build our first TextBlock. To do that, I'm going to declare a new variable of type String and I'll name it multilineText. Then, in order to start the TextBlock, we're going to place our opening delimiter and it's going to be three quotation marks. After the three quotation marks, we're going to specify a line terminator by hitting…

Contents