Introduce about text block in Java
Previously, when declaring a multi-line text in Java, for example:
|
1 2 |
Welcome to Huong Dan Java My name is Khanh |
We will usually declare the following:
|
1 2 |
String text = "Welcome to Huong Dan Java \n" + "My name is Khanh"; |
Result: 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… Read More


