Page 253 - Cs_withBlue_J_C11_Flipbook
P. 253

4.  The keyword ………………… allows only the methods to be accessed by the same class.
                       a.  public                                      b.  private
                       c.  protected                                   d.  None of these
                    5.  input(num): Here num is the ………………… .
                       a.  parameter                                   b.  argument
                       c.  method                                      d.  None of these
                    6.  The parameters that receive the values from the caller program are known as ………………… parameters.
                       a.  Actual                                      b.  Formal
                       c.  Both a and b                                d.  None of these
                    7.  The ………………… data members are sent as parameters in Pass By Value.
                       a.  Derived                                     b.  primitive
                       c.  Both a and b                                d.  None of these
                    8.  Methods that does not change the values that are passed to it known as ………………… .
                       a.  Impure method                               b.  Static method
                       c.  Pure Method                                 d.  All of these
                    9.  A class consists of characteristics and behaviour which are used to create ………………… .
                       a.  Method                                      b.  Constructor
                       c.  External Wrapper                            d.  Objects
                    10.  This type of constructors is created automatically ………………… .
                       a.  Non-Parameterised constructor               b.  Default Constructor
                       c.  Parameterised Constructor                   d.  none of these

                 B.  Fill in the blanks:
                    1.  A ………………… is a member function having the same name as that of a class and is used to initialise the instance variables of the
                       objects that are created.
                    2.  The ………………… method uses only static data members.

                    3.  These Non-Static Data Members are created whenever any object is generated and are known as ………………… .
                    4.  ………………… are variables described within a class and can be used to store values whenever required.
                    5.  The two parts of a class are ………………… and ………………… .
                    6.  Consider the given program:
                       class cal
                       {
                          static int a=1;
                          double b;
                          static void assign()
                          {
                              a++;
                          }
                          void input(int n)
                          {
                              b=n;
                          }
                          void display()
                          {
                              int c=5;
                              System.out.println(b+c);
                          }
                       }
                        What are the following variables known as:
                        a.     a : …………………
                        b.     b : …………………



                                                                                                                       251
                                                                                              Methods and Constructors  251
   248   249   250   251   252   253   254   255   256   257   258