Comments on: Java Text Blocks https://www.happycoders.eu/java/text-blocks/ Wed, 27 Nov 2024 13:51:54 +0000 hourly 1 By: Sven Woltmann https://www.happycoders.eu/java/text-blocks/#comment-17408 Wed, 21 Sep 2022 06:47:44 +0000 https://www.happycoders.eu/books/java-text-blocks/#comment-17408 In reply to Roman.

Hi Roman, thanks so much for pointing this out to me. I have fixed the code now.

]]>
By: Roman https://www.happycoders.eu/java/text-blocks/#comment-17376 Fri, 02 Sep 2022 10:00:27 +0000 https://www.happycoders.eu/books/java-text-blocks/#comment-17376 Hey Sven, nice article, thank you!
However, when you wrote about backslash at the end of the line, seems you missed a couple of backslashes in this snippet:
----------------------------------------
String sql = """
SELECT id, firstName, lastName
FROM Employee
WHERE departmentId = "IT"
ORDER BY lastName, firstName""";
----------------------------------------
This would result in:
---
SELECT id, firstName, lastName
FROM Employee
WHERE departmentId = "IT"
ORDER BY lastName, firstName
---
instead of expected:
---
SELECT id, firstName, lastName FROM Employee
WHERE departmentId = "IT" ORDER BY lastName, firstName
---

]]>