0% found this document useful (0 votes)
5 views1 page

Java Escape Sequences Explained

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Java Escape Sequences Explained

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Escape Sequence: Java supports all escape sequence which is supported by C/ C++ .

A character preceded by a backslash (\) is an escape sequence and has special meaning to the compiler
When an escape sequence is encountered in a print statement, the compiler interprets it accordingly

Escape Sequence Description


\t Insert a tab in the text at this point
\b Insert a backspace in the text at this point
\n Insert a newline in the text at this point
\r Insert a carriage return in the text at this point
\f Insert a form feed in the text at this point
\' Insert a single quote character in the text at this point
\" Insert a double quote character in the text at this point
\\ Insert a backslash character in the text at this point

You might also like