Page 283 - CA_Blue( J )_Class10
P. 283

Let’s Revisit


                       ®  An object is a fundamental unit of object-oriented programming.
                       ®  A class is a blueprint to create several objects with the same properties and behaviour.
                       ®  An object of a class is also called an instance and the process of creating an object of a class is called instantiation.
                       ®  The access specifiers restrict the scope of the uses of data members and member methods within the class or outside the
                       class.
                       ®  There are three types of data members which are instance variables, class variables and local variables.
                       ®  A method that is declared within the class is called a member method.
                       ®  A method that is declared within the class using the static keyword is called the static member method.
                       ®  Constructors are special methods with name same as that of the class name.
                       ®  When a class is declared within another class then it is called a nested class.
                       ®  The this keyword denotes the current class’s object.





                                                          MIND DRILL






                          Solved Questions


                 A.  Tick ( ) the correct answer.
                    1.  Which of the following is a fundamental unit of object-oriented programming?
                       a.  Class                                       b.  Object
                       c.  Method                                      d.  Variable
                    2.  Which of the following is a set of instructions to build a specific type of object?
                       a.  Class                                       b.  Object
                       c.  Both a and b                                d.  None of these
                    3.  Which of the following is the process of creating an instance of a class?
                       a.  Initialisation                              b.  Instantiation
                       c.  Modification                                d.  None of these
                    4.  The ………………… data members or the member methods can only be accessed within the class in which they are declared.
                       a.  public                                      b.  protected
                       c.  private                                     d.  all of these
                    5.  Which of the following is a component of an object?
                       a.  Characteristics                             b.  Behaviour
                       c.  Both a and b                                d.  None of these
                    6.  What is the primary purpose of a class in object oriented programming?
                       a.  To execute a sequence of commands           b.  To represent a blueprint for objects
                       c.  To handle file operations                   d.  To perform mathematical calculations
                    7.  Which of the following is true about classes and objects?
                       a.  A class is an instance of an object
                       b.  An object is a blueprint of a class
                       c.  A class defines properties and behaviors, while an object is an instance of a class
                       d.  Objects and classes are the same



                                                                                                                       281
                                                                                      Class as the Basis of all Computation  281
   278   279   280   281   282   283   284   285   286   287   288