4. Java Escape Sequences

 What is Java Escape Sequences ? With Example Code

Sing a This Sentence like this....

Big Farmer Need  Red  Tractor

\b      \f           \n      \r      \t

\b = backspace

\f  = Form feed (*)

\n = Print New line

\r = Carriage return ( Enter)

\t = Horizontal tab (TAB Space)

Escape sequences define special character for in side java Code 


class Hello {
 public static void main(String args[]){
    System.out.println("Hello World This is\b ezcod.blogspot.com ");
    System.out.println("Hello World This is\f ezcod.blogspot.com ");
    System.out.println("Hello World This is\n ezcod.blogspot.com ");
    System.out.println("Hello World\r This is ezcod.blog\tspot.com ");	
 }
}

OUTPUT
Hello World This i ezcod.blogspot.com 
Hello World This is ezcod.blogspot.com 
Hello World This is
 ezcod.blogspot.com 
 This is ezcod.blog	spot.com 


Download Src Code on Github Here





Post a Comment

Previous Post Next Post

Featured Post