Page 62 - CA_Blue( J )_Class9
P. 62

Carriage Return (\r)
                  It is used to insert a carriage return in the text.


                   Program 9      Write a program to demonstrate the use of \r.

                     1  class escapesequence_carriagereturn
                     2  {

                     3      public static void main()
                     4      {

                     5          System.out.println("Use of Carriage Return: India\rCountry");
                     6      }

                     7  }

                   You will get the following output:














                  Back Slash (\\)
                   It is used to insert a back slash character in the text.

                   Program 10     Write a program to demonstrate the use of \\.

                     1  class escapesequence_backslash

                     2  {

                     3      public static void main()
                     4      {
                     5          System.out.println("Backslash: India\\Country");

                     6      }
                     7  }

                  You will get the following output:

















                    60    Touchpad Computer Applications-IX
   57   58   59   60   61   62   63   64   65   66   67