Java Program

Object:-Write a program to implement escape sequene in java.

class EscapeSequences
{
 public static void main(String...s)
 {
  System.out.print("tCseWorld Online");
  System.out.print("nCseWorld Online");
  System.out.print("nCse bWorld Online");
  System.out.print(" 'CseWorld Online' ");
  System.out.print("n"CseWorld Online"");
 }
} 

Output

CseWorld Online
CseWorld Online
CseWorld Online

Explanation

In this Program we have used the escape sequence

As some of them are given below-

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.








You may also like: