Text Blocks with Escape Sequences in Java
Java 15 introduced an enhancement to text blocks that allows for the inclusion of escape sequences within the text block. This feature allows for the easy inclusion of special characters like quotes and backslashes within the text block.
Example:
String sql = """
SELECT *
FROM employees
WHERE department = 'IT'
AND status = 'ACTIVE'
""";
No comments:
Post a Comment