Finally, Java has introduced the feature many developers like me looking for. Handling the string which has multiple lines in it, we had to use concatenation approach to store it in a String object. It was hard to handle HTML output from java program or Servlet sometime.
For example, here was the approach to handle multiple lines of HTML output earlier.
String output = "<html>\n" +
" <body>\n" +
" <h1>Welcome</h1>\n" +
" <p>This is welcome Page</p>\n" +
" </body>\n" +
"</html>\n";
Now, we can handle it without concatination of multiple strings.
String output = """
<html>
<body>
<h1>Welcome</h1>
<p>This is welcome Page</p>
</body>
</html>
""";
Comments