Page 341 - CA_Blue( J )_Class10
P. 341

iii. Which of the following is NOT a primitive data type in Java?
                          a. float                                     b.  String
                          c. boolean                                   d.  char
                        iv. What are composite data types also known as?
                          a. Primary types                             b.  Secondary types
                          c. Reference types                           d.  Object types
                        v. Which of the following are composite data types in Java?
                          a. byte, int, char                           b.  float, double, long
                          c. Arrays, Strings, Interfaces               d.  short, boolean, double
                   Ans.  1. (i) c   (ii) d
                       2. (i) c   (ii) b   (iii) b   (iv) c   (v) c

                      Unsolved Questions



                 A.  Tick ( ) the correct answer.
                    1.  What will be the output of the Character.isLetterOrDigit('s') method?
                       a.  True                                        b.  true
                       c.  false                                       d.  False
                    2.  What will be the return type of the Integer.parseInt(“120”) method?
                       a.  boolean                                     b.  String
                       c.  int                                         d.  double
                    3.  The System.out.print(Integer.parseInt(“2”)+Double.parseDouble(“3.5”)) will return ………………….
                       a.  23.5                                        b.  5.5
                       c.  5                                           d.  5.0
                    4.  Which of the following methods checks that the parameter is space or not?
                       a.  isUpperCase()                               b.  toUpperCase()
                       c.  isWhitespace()                              d.  None of these
                    5.  Which of the following methods is used to convert the String into double?
                       a.  Double.valueOf(String)                      b.  Double.parseDouble(String)
                       c.  Double.toString(String)                     d.  None of these
                    6.  Which method is used to determine whether a character is a digit in Java?
                       a.  isDigit(char ch)                            b.  isLetter(char ch)
                       c.  isLowerCase(char ch)                        d.  isUpperCase(char ch)
                    7.  What does the Character.isLetter(char ch) method return?
                       a.  true if the character is a lowercase letter
                       b.  true if the character is an uppercase letter
                       c.  true if the character is a letter (either lowercase or uppercase)
                       d.  false if the character is not a letter
                    8.  Which method is used to convert the character argument to lowercase?
                       a.  toLowerCase(char ch)                        b.  toUpperCase(char ch)
                       c.  toLower(char ch)                            d.  toLowercase(char ch)
                    9.  What is autoboxing in Java?
                       a.  Converting a primitive type to its corresponding wrapper class object
                       b.  Converting a wrapper class object to its corresponding primitive type
                       c.  Converting between different primitive types
                       d.  Converting between different wrapper classes
                   10.  Which of the following statements is true regarding autoboxing and unboxing?
                       a.  Autoboxing is the process of converting a wrapper class object to its corresponding primitive type.
                       b.  Unboxing is the process of converting a wrapper class object to its corresponding primitive type.
                       c.  Autoboxing and unboxing are the same processes.
                       d.  Autoboxing and unboxing are not related.

                                                                                                                       339
                                                                                                        Library Classes    339
   336   337   338   339   340   341   342   343   344   345   346