Page 344 - CA_Blue( J )_Class10
P. 344

8.  Name the wrapper classes of char type and boolean type.                                     [2015]
                Ans.  Wrapper class of char type is Character.
                    Wrapper class of boolean type is Boolean.
                  9.  State the data type and value of y after the following is executed:                         [2015]
                    char x ='7';
                    y = Character.isLetter(x);
                Ans.  Data type of y is boolean and value of y is false.
                 10.  List the variables from those given below that are composite data types:                    [2014]
                    (i)  static int x;                              (ii)  arr[i] = 10;
                    (iii) obj.display();                           (iv)  boolean b;
                    (v) private char chr;                          (vi)  String str;
                Ans.  The composite data types are
                    (ii) arr[i] = 10                               (iii)  obj.display()
                    (vi) String str
                 11.  What will be the output when the following code segments are executed?                      [2014]
                    String s = "1001";
                    int x = Integer.valueOf(s);
                    double y = Double.valueOf(s);
                    System.out.println("x = " + x);
                    System.out.println("y = " + y);
                Ans.  x = 1001                                      y = 1001.0
                 12.  Name any two wrapper classes.                                                               [2013]
                Ans.  Boolean and Integer are two Wrapper Classes.
                 13.  What data type is return by the isWhitespace(char ch) library function?
                Ans.  The data type returned is boolean.
                 14.  Give one example each of a primitive data type and a composite data type.                   [2012]
                Ans.  One example of primitive data type is int and composite data type is array.
                 15.  State the method that:                                                                      [2012]
                    (i)  Converts a string to a primitive float data type.
                    (ii) Determines if the specified character is an uppercase character.
                Ans.  i.  Float.parseFloat()                        ii. Character.isUpperCase()







































                342342  Touchpad Computer Applications-X
   339   340   341   342   343   344   345   346   347   348   349