Basically, \n helps you to create a new line. Similarly, we have different escape sequences:
Escape Sequences
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 formfeed 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.
I hope this will help.
Want to become a Java expert? join Java Certification now!!
Want to know more about Java? Watch this video on Java Tutorial for Beginners | Java Programming: