Page 60 - CA_Blue( J )_Class9
P. 60

Double Quote (\")
                  It is used to insert a double quote character in the text. It is mainly used to print direct sentences. For example, if
                  we want to print in the following pattern: He said, "I eat two apples".


                   Program 5      Write a program to demonstrate the use of \".

                     1  class escapesequence_doublequotation
                     2  {

                     3      public static void main()
                     4      {

                     5          System.out.println("He said,\"I eat two apples\"");
                     6      }

                     7  }

                  You will get the following output:











                  Single Quote (\')
                  It is used to insert a single quote character in the text. For example, if we want to print in the following pattern:
                  'INDIA' is the 'seventh' largest country in the world.


                   Program 6      Write a program to demonstrate the use of \'.

                     1  class escapesequence_singlequotation
                     2  {

                     3      public static void main()
                     4      {

                     5          System.out.println("\'INDIA\' is the \'seventh\' largest country in the
                           world.");
                     6      }

                     7  }

                  You will get the following output:













                    58    Touchpad Computer Applications-IX
   55   56   57   58   59   60   61   62   63   64   65