Skip to content
Sharp

Modern Java · interview question

How do you include a double quote within a Java text block?

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

Correct answer

D. Use \" inside the text block.

Why

To include a double quote within a Java text block, you use the escape character \". This allows you to include double quotes without ending the text block.

Test yourself on Modern Java

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

Start free test
All Modern Java questions →