Which of the following is an escape sequence character in Java?

ICSE Class 10 Computer Applications PYQ · 2024 Paper · Section A

1(vi)1 Mark · 2024 · Section A · 2024 Paper

Which of the following is an escape sequence character in Java?

Show SolutionHide Solution↓

\t

Reason — In Java, an escape sequence is a combination of characters starting with a backslash (\) followed by a specific character that performs a special operation.

Analysing the given options:

  1. /n – Incorrect, should be \n (Backslash is required).
  2. \t – Correct, it represents a tab.
  3. /t – Incorrect, should be \t.
  4. //n – Incorrect, this is not an escape sequence; // is used for comments in Java.
← Previous questionNext question →

Browse the free Computer Applications sample bank