0
9.7kviews
Explain generalization and inheritance.

Subject: Object Oriented Modeling and Design

Difficulty: Medium

Marks: 4 Marks

1 Answer
1
1.1kviews

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. enter image description here

Example:-

enter image description here

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: enter image description here

Please log in to add an answer.