Skip to content
Sharp

Modern Java · interview question

Which of the following is not a feature of Java text blocks?

Multiple choiceMediumchapter-12-curatedpremiummodern-javatext-blocks
Choose one answer
Answer and explanation

Correct answer

D. Automatic escaping of JSON.

Why

Text blocks do not automatically escape JSON or any specific data format. They allow multiline strings and simplify the syntax by eliminating the need for string concatenation, but escaping must be handled as needed.

Test yourself on Modern Java

A free test with instant, explained results. No account needed.

Start free test
All Modern Java questions →