|
Return to Unit Menu | JavaBitsNotebook.com | MathBits.com | Terms
of Use | JavaMathBits.com
Escape Sequences
The following is a table of escape sequences to be used when printing in Java.
These statements are embedded within a literal print remark (they go
between the quotes):
Sequence |
Name |
Meaning |
\n |
New line |
Moves to beginning of next line
|
\b |
Backspace |
Backs up one character |
\t |
Horizontal tab |
Moves to next tab position
Tab spacing is every 8 columns
starting with 1.
(Columns 9, 17, 25, 33, 41, 49, 57, 65, 73 ...) |
\\ |
Backslash |
Displays an actual backslash |
\' |
Single quote |
Displays an actual single quote |
\" |
Double quote |
Displays an actual double quote |
System.out.println("\tGeorge\t\tPaul");
will tab, print George, tab twice more, and print Paul.
George Paul
Return to Unit Menu | JavaBitsNotebook.com | MathBits.com | Terms
of Use | JavaMathBits.com
Notice: These materials are free for your on-line use at this site, but are not free for the taking.
Please do not copy these
materials or re-post them to the Internet, as it is copyright infringement.
If you wish hardcopies of these materials, refer to our subscription area, JavaMathBits.com.
Help us keep these resources free. Thank you. |
|