Page 265 - Computer science 868 Class 12
P. 265

Unsolved Questions



                 A.  Tick ( ) the correct option:
                    1.  Following is/are the type(s) of the access specifiers.
                       a.  Public                                      b.  Private
                       c.  Protected                                   d.  All of these
                    2.  ………………… operator is required to use the object of the class from the member method from the same class.
                       a.  this                                        b.  unary
                       c.  binary                                      d.  Arithmetical
                    3.  ………………… does not have a return type.
                       a.  pure method                                 b.  constructor
                       c.  impure method                               d.  None of these
                    4.  int cal(int a) ………………… .
                       a.  returns nothing                             b.  returns double value
                       c.  returns int value                           d.  uses logic of pass-by reference
                    5.  The ………………… special type of constructor that is used to create an object by initialising it with a previously created object of the
                       same class.
                       a.  default constructor                         b.  no-argument constructor
                       c.  copy constructor                            d.  parameterised constructor
                    6.  void num_calc(int num,char ch) - This method has ………………… parameters.
                       a.  1                                           b.  2
                       c.  3                                           d.  4
                    7.  This method is used to delete the leading and trailing spaces from the string of the current object.
                       a.  endsWith()                                  b.  trim()
                       c.  compareto()                                 d.  All of these
                    8.  What will be the output of the following?
                       String s="India is a large country";
                       System.out.println(s.substring(6,12));
                       a.  is a l                                      b.  large
                       c.  is a large                                  d.  India is a large country
                    9.  These methods are used to convert Primitive data types to String and vice versa.
                       a.  Methods of Wrapper class                    b.  Methods of Character class
                       c.  Methods of Math class                       d.  None of these
                    10.  The output of this method is true if the argument is an alphabet and false otherwise.
                       a.  Character.isWhitespace('ch')                b.  Character.isLetter(char)
                       c.  Character.toUpperCase(char)                 d.  Character.toLowerCase(char)
                 B.  Fill in the blanks:
                    1.  ………………… occupy less space in memory and the execution becomes faster.
                    2.  ………………… statement is required if the function is returning some value.
                    3.  ………………… are variables list sent to the methods for execution.
                    4.  The parameters that receive the values from the caller program are known as ………………… parameters.
                    5.  The copy of the actual parameters is passed to the formal parameters in such a way that any change made in the formal parameters
                       will not affect the actual parameters, then it is referred to as ………………… .
                    6.  ………………… is also known as Accessor.
                    7.  void area(double r)
                       {
                         double ar=3.142 * r * r;
                         System.out.println("The Area of a circle "+ ar);
                       }
                        The function calculates the ………………… .


                                                                                                                       263
                                                                                                            Methods    263
   260   261   262   263   264   265   266   267   268   269   270