MCQ Single Best Answer Moderate

QWhich escape sequence in Java is used to represent a newline character?

ID: #19866 Escape sequences in Java 99 views
Question Info
#19866Q ID
ModerateDifficulty
Escape sequences in JavaTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A \n
  • B \t
  • C \r
  • D \
Correct Answer: Option A

Explanation

The correct escape sequence to represent a newline character in Java is \n.
No Previous Next Question

Share This Question

Challenge a friend or share with your study group.