Text Blocks in Java
Java 15 introduced Text Blocks, which provide a convenient way to declare multi-line strings without the need for escape sequences or concatenation.
Example:
String html = """
<html>
<body>
<h1>Hello, World!</h1>
</body>
</html>
""";
No comments:
Post a Comment