Page 262 - CA_Blue( J )_Class10
P. 262

11                       CLASS AS THE BASIS OF



                                                                     ALL COMPUTATION














                        Learning Objectives




                   11.1 Object                                           11.2 Class
                   11.3 Difference between Class and Object              11.4 Creating Objects of a Class
                   11.5 Different Component of a Class                   11.6 Nested Class
                   11.7 Class as an Object Factory                       11.8 Using this Keyword





              When you see around yourself, you will find several objects like a pencil, mobile, car, bicycle, book, eraser, etc. These
              objects are called real-world objects. Each of these objects has its own properties like size and colour. Every object has
              a different purpose and performs a specific action.

              Similarly, object-oriented programming is based on the objects. These objects are known as software objects. To solve
              a problem using object-oriented programming, the first step is to identify the objects in it. For example, if you want to
              bake a cheese pizza, then you need to identify the ingredients (objects) first.


                   11.1 OBJECT
              An object is a fundamental unit of object-oriented programming. It has state, attributes (characteristics) and behaviour.
              In the real world, an object is an entity that has a definite shape and is visible to us. The different components of an
              object are:
              •  Characteristics or attributes: The properties of an object are called characteristics or attributes. It is also known as
                  the state of an object.
              •  Behaviour or methods: The action that an object can perform is called its behaviour.



                               Object name:     Computer
                               Characteristics:  Speed
                                                Memory
                                                Accuracy
                               Behaviour:       Processing
                                                Storing

              While programming, attributes of an object are represented by the data members known as member variables, like
              speed and storage. The behaviour of an object is represented by the member method like processing( ).



                260260  Touchpad Computer Applications-X
   257   258   259   260   261   262   263   264   265   266   267