Introduce about text block in Java

Previously, when declaring a multi-line text in Java, for example:

We will usually declare the following:

Result:

Introduce about text block in Java

But from Java 13 onwards, you do not need to declare so anymore. Java now supports the text blocks with the ability to declare multiple lines without the need for plus signs (+) to concatenate strings. In the above example, we can now rewrite the following:

You just need to declare your multi-line text between two characters (“””).

The same result:

Introduce about text block in Java

Chia sẽ bài viết này ...Share on Facebook
Facebook
0Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin

Add Comment