| written 6.9 years ago by | • modified 6.9 years ago |
Subject: Object Oriented Modeling and Design
Difficulty: Medium
Marks: 4 Marks
| written 6.9 years ago by | • modified 6.9 years ago |
Subject: Object Oriented Modeling and Design
Difficulty: Medium
Marks: 4 Marks
| written 6.9 years ago by |
Generalization: It is also referred as „is-a‟ relationship. It is relationship between a class (super class) and one or more variations of the class (sub classes).It organizes classes by their similarities and differences, structuring the description of objects. The super class holds common attributes, operations and association. The subclasses add specific attributes, operations and associations. Each sub class inherits the features of its super class.
Notation: A large hollow arrowhead is used to show generalization. The
arrowhead points towards the super class.

Example:-

Inheritance: It is the mechanism of inheriting features of super class in its subclass. Inheritance provides reusability of code where code declared for super class can be used by its sub class.
Example:
