Page 76 - CITS - CSA - TP (Volume 2) - Hindi
P. 76

कं  ूटर सॉ वेयर ए ीके शन - CITS




           टा  4: िकसी कै रे र को    ंग म  बदल

           public class CharacterExample4 {
               public static void main(String[] args) {
                   char ch = ‘X’;



                   String charString = Character.toString(ch);
                   System.out.println(“Character as String: “ + charString);

               }
           }

           आउटपुट:

















           टा  5: जाँच  िक  ा कोई कै रे र  र   ान कै रे र है
           public class CharacterExample5 {
               public static void main(String[] args) {

                   char ch1 = ‘ ‘;
                   char ch2 = ‘A’;



                   System.out.println(ch1 + “ is a whitespace character: “ + Character.isWhitespace(ch1));
                   System.out.println(ch2 + “ is a whitespace character: “ + Character.isWhitespace(ch2));
               }

           }
           आउटपुट:























                                                           62

                                   CITS : IT & ITES - कं  ूटर सॉ वेयर ए ीके शन - अ ास 91
   71   72   73   74   75   76   77   78   79   80   81