Skip to content
Sharp

Modern Java · interview question

How would you explain a text block in a Java interview?

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

Correct answer

D. A multiline string literal.

Why

A text block in Java is a multiline string literal that allows developers to write long strings over multiple lines without the need for explicit concatenation or escaping of special characters.

Test yourself on Modern Java

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

Start free test
All Modern Java questions →