Escape Sequences in Java

Java supports various Escape Sequences such as ‘\n’ for new-line and ‘\t’ for tab space. These are written as below:

Symbol Meaning
\n New line
\t Tab space
\a Audible alert (beep)
\v Vertical tab
\f Form feed
\b backspace
\\ To make ‘\’
\’ Single quote
\” Double quote
\? Double quote
\r Carriage return

Leave a Reply