Page 103 - computer science (868) class 11
P. 103

MIND DRILL



                     Solved Questions


                 A.  Tick ( ) the correct option:
                    1.  A class consists of characteristics and behaviour that are used to create …………………. .
                       a.  objects                                     b.  object factory
                       c.  programs                                    d.  None of these
                    2.  A real-world object has …………………. and …………………. .
                       a.  methods, data members                       b.  characteristics, methods
                       c.  characteristics, behaviour                  d.  All of these
                    3.  Which of the following is a blueprint to create similar kinds of objects?
                       a.  Instance                                    b.  Class
                       c.  Method()                                    d.  All of these
                    4.  The Java programs written by programmers are saved with the extension …………………. .
                       a.  Java                                        b.  .java
                       c.  .jv                                         d.  .jva
                    5.  Which of the following blocks, if present, always executes whether there is an exception or not?
                       a.  Try                                         b.  Catch
                       c.  finally                                     d.  Throw
                  Answers
                    1.  a     2.  c     3.  b     4.  b     5.  c


                 B.  Fill in the blanks:
                    1.  A class is a ………………… data type.
                    2.  Each class is made up of some attributes (data members) that are ………………… data types.
                    3.  A ………………… uses software instead of a physical computer to execute programs and install apps.

                    4.  ………………… is created once in a program.
                    5.  ………………… is a mechanism to handle errors that occur during the execution of the program so that the normal flow of the code
                       can be maintained.

                   Answers
                   1.  user-defined    2.  predefined       3.  Virtual Machine   4.  Class      5.   Exception handling

                 C.  Answer the following questions:
                    1.  What are the components of objects?
                   Ans.  The components of objects are characteristics, behaviours, and events.
                    2.  What are the components of classes?
                   Ans.  The components of classes are the access specifier, class keyword, name given to the class, data members and methods.
                    3.  What is a user-defined data type? Give an example of it.
                   Ans.  A user-defined data type is a derived data type depending on some existing data types. Class is an example of a user-defined
                       data type.
                    4.  Define object.
                   Ans.  An object is a unique entity that contains properties, methods and events together in an object-oriented programming language.
                    5.  Define class.
                   Ans.  A class in Java is a non-primitive/user-defined data type that acts as a blueprint for creating objects of the same type.



                                                                                                                       101
                                                                                                             Objects   101
   98   99   100   101   102   103   104   105   106   107   108