Saturday, 5 September 2015

Generalization & Specialization in OOPS

Generalization:
The concept of generalization in OOP means that an object encapsulates common state and behavior for a category of objects.

Example: The geometric shape is an object and most geometric shapes have area, perimeter, and color.

Specialization:
The concept of specialization in OOP means that an object can inherit the common state and behavior of a generic object. However, each object needs to define its own special and particular state and behavior.

Example: Each geometric shape has its own color and particular formulas to calculate its area and perimeter.

No comments :

Post a Comment