Skip to main content

Generalization & Specialization in OOPS

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.

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.