Computer Applications
Which of the following is an escape sequence character in Java?
/n
\t
/t
//n
Answer
\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:
/n
– Incorrect, should be\n
(Backslash is required).\t
– Correct, it represents a tab./t
– Incorrect, should be\t
.//n
– Incorrect, this is not an escape sequence;//
is used for comments in Java.