Page 67 - Viva ICSE Computer Studies 8 : E-book
P. 67

properties are inherited is known as parent class. It helps to reuse the code and establish a
                    relationship between diff erent classes. Inheritance allows to enlarge the functionality of a class
                    which already exists. You make a class that uses the attributes and behavior of another class.
                    It doesn’t mean that the new class only acquires the attributes of the existing class but it
                    consists of a few new attributes and behaviors that are specifi c to the class.
                                                                                    ABILITIES
                                INHERITED SKILLS
                                                                                    • Cook
                                NEW SKILLS
                                                                                    •  Sing
                                                                                    •  Dance
                                                                                    •  Teach













                                ABILITIES                   ABILITIES                     ABILITIES
                                • Cook                      • Cook                        • Cook
                                •  Sing                     •  Sing                       •  Sing
                                •  Dance                    •  Dance                      •  Dance
                                •  Teach                    •  Teach                      •  Teach
                                •  Fly Planes               •  Code                       •  Shoot Guns
                                •  Play Football                                          •  Repair Electronics


                    Polymorphism


                    Polymorphism is obtained from two Latin words: poly and morph. Poly means many and morph
                    means forms. Anything can be called polymorph when it is present in more than one form.
                    Now let’s understand the concept with an example. Suppose, you are in a classroom, at that
                    time you will behave like a student, when you are in market, you will behave like a customer,
                    when you at your home you will behave like a son or daughter. Here, one person presents
                    varied behaviors. Hence, he exhibits polymorphism.

                    Starting BlueJ
                                                                                   Step 2
                    Follow these steps to start BlueJ.
                      1.  Click on the Start button.

                      2.  Click on the BlueJ option in the menu.
                           A ‘BlueJ’ screen appears, followed by BlueJ
                           working environment screen.


                                                                                  Step 1






                                                                                                                    55
   62   63   64   65   66   67   68   69   70   71   72