Page 49 - CA_Blue( J )_Class9
P. 49

3.5 DIFFERENCE BETWEEN CLASS AND OBJECT
                 Let’s learn how class and objects are different:

                                        Class                                            Object
                 Class is the blue print from which objects are created.  Object is an instance of a class.

                 It is  a logical  entity that defines  attributes and  It is a physical entity that exists in memory.
                 behaviours.

                 No memory space is allocated when a class is created.  Memory space is allocated when an object is created.
                 A class is defined once and can be used to create as  An object is created each time it is instantiated from a
                 many objects as needed.                            class.




                                Let’s Revisit



                      The concept of class and object is obtained by programs written using object-oriented programming languages
                      such as Java, C++, etc.
                      A class consists of characteristics and behaviours.

                      Class is a non-primitive data types that act as a blueprint for creating objects of the same type.
                      To declare a class, we need "Access Specifier", "class" keyword, "name given to class", "Data members" and
                      Methods".
                      Objects are the instance of a class.

                      Components of Objects are: characteristics, behaviours, and the Object name.








                                                            MIND DRILL





                      Solved Questions



                 A.  Tick ( ) the correct answer.
                    1.  The entire program in Java is ………………… in class.
                        a.  polymorph                                  b. encapsulated
                        c.  objects                                    d. instance
                    2.  A class consists of characteristics and behaviour which are used to create ………………….
                        a.  basic structure                            b. programs
                        c.  Objects                                    d. Variables
                    3.  Which of the following is called template used to create objects that share common characteristics and behaviour?
                        a.  Instance                                   b. Object
                        c.  Class                                      d. Methods

                                                                          Elementary Concept of Objects and Classes  47
   44   45   46   47   48   49   50   51   52   53   54