Fundamentals

OOP interview question · Easy difficulty

What are the four pillars of OOP?easy

Status
✓
Type
conceptual
Topic
fundamentals
Frequency
very common
Tags
fundamentals
Answer

Encapsulation, inheritance, polymorphism, and abstraction.

Explanation

Encapsulation hides internal state. Inheritance lets classes share behaviour through parent-child relationships. Polymorphism lets different types be used through a common interface. Abstraction hides complexity behind clean interfaces. Together they promote modularity, reuse, and maintainability.

Follow-upGive a concrete example of each pillar in a language you use.