Page 33 - CA_Blue( J )_Class10
P. 33

8.  What does the keyword represent in a class?
                       a.  The superclass of the current object        b.  The current object instance
                       c.  The class itself                            d.  A static method

                  Answers
                  1. a             2. a             3. b              4. a             5. c
                  6. a             7. c             8. b


                 B.  Fill in the blanks.

                    1.  An ………………… is the physical existence of the class.
                    2.  A class consists of ………………… and behaviours.
                    3.  A class is a ………………… to build a specific type of object.
                    4.  A ………………… does not take any memory space in a computer.
                    5.  A ………………… is a function that has the same name as that of a class.
                    6.  ………………… programming allows us to develop programs by using the concept of class and object.

                  Answers
                  1. object        2. characteristics       3. blueprint           4. class         5. constructor
                  6. Object_oriented


                 C.  Answer the following questions:
                    1.  In the real world, if “computer” is a class, then name some of its objects.
                   Ans.  In the real world, if “computer” is a class then the different types of computers are Supercomputer, Mainframe computer,
                       Minicomputer, Desktop and Laptop are the objects.
                    2.  Name some components of objects.
                   Ans.  The components of objects are characteristics, behaviours, and the object name.
                    3.  Why class is known as object factory?
                   Ans.  Factories are places that produce products of the same kind. In the same way, a class acts as a factory as it is used to create similar
                       types of objects with different characteristics and common behaviours. Hence, a class is called an object factory.
                    4.  Why objects are known as an instance of a class?
                   Ans.  While creating an object of a class, we are basically defining a variable that has the size of the total bytes of all the data members.
                       An object is also called an instance of a class as it has the same properties as its class.
                    5.  “Class is a user-defined data type.” Explain briefly.
                   Ans.  A user-defined data type is a derived data type depending on some existing data types. A Java program is made up of classes
                       and each class is made up of some attributes (data members) which are predefined data types. Thus, we can say a class is a
                       user-defined data type.
                 D.  Assertion and Reasoning based questions.

                       The following questions consist of two statements – Assertion (A) and Reason (R). Answer these questions by selecting the
                       appropriate option given below:
                       a.  Both A and R are true, and R is the correct explanation of A.
                       b.  Both A and R are true, but R is not the correct explanation of A.
                       c.  A is true, but R is false.
                       d.  A is false, but R is true.
                    1.  Assertion (A): An object in Java can be created without using the new keyword.
                        Reason (R): The new keyword is used to allocate memory and initialize a new object in Java.
                    2.  Assertion (A): The new keyword in Java creates an instance of a class and initializes it.
                        Reason (R): The new keyword is followed by a constructor which initializes the new object.
                   Ans.  1. d    2. a


                                                                                                                       31
                                                                                 Elementary Concept of Objects and Classes  31
   28   29   30   31   32   33   34   35   36   37   38