Page 38 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 38

Object Oriented Analysis and Design




                    Notes
                                                             Figure 3.9: Single Inheritance

                                                                      Shape


                                                                      Draw ()

                                                                      Er a s e ( )
                                                                      Erase ()






                                             Circle                    Triangle               Square


                                   Source: http://vedyadhara.ignou.ac.in/wiki/images/a/aa/B1U1mcs-032.pdf
                                   In multiple inheritances, one class is inherited from more than one class.


                                          Example: Multiple inheritances is shown in Figure 3.10.

                                                            Figure 3.10: Multiple  Inheritance

                                                    Fly Things                Run Things




















                                           Aeroplane                    Helicopter               Car


                                   Source:  http://vedyadhara.ignou.ac.in/wiki/images/a/aa/B1U1mcs-032.pdf
                                   Self Assessment


                                   Fill in the blanks:
                                   10.  The notation for ................... is a triangle connecting a super class to its subclasses.
                                   11.  ................... is used for sharing attributes and operations using the generalization
                                       relationship.
                                   12.  In ................... inheritance, one class is inherited from more than one class.




          32                                LOVELY PROFESSIONAL UNIVERSITY
   33   34   35   36   37   38   39   40   41   42   43