What is a text block? - Cracking the Java Coding Interview

preview_player
Показать описание
Cracking the #Java #Coding #Interview - Question 151: What is a text block?
Рекомендации по теме
Комментарии
Автор

This is much nicer than concatenating a bunch of strings with + and then manually aligning them to the same indentation.

neilvonholtum
Автор

In point of fact. After the triple quote the first line determines how you indent it in the code that you're writing but in subsequent lines that's the actual indentation that isn't disregarded.

Gennys
Автор

Yes I have used this text block in a springboot jdbc tempate application to write sql. Nice

whiz-code
Автор

0:31 That's not right, you still need to escape backslashes in a text block.
You can also add a single backslash at the end of a text block line to continue on the next line in the source code without a new line being added to the String.

jay_
Автор

I guess this is better to avoid concatenations. Especially when writing SQL queries

davidmurege
Автор

I thought this was called multiline string
i thought last 3 quotes should be on their own line

jasondads
Автор

Why did you have to complicate this feature?

ahmedjaad
join shbcf.ru