Explain the four pillars of Object-Oriented Programming.

Beginner

Answer

1. Encapsulation: Bundling data and methods together, hiding internal implementation details.
2. Inheritance: Creating new classes based on existing classes, promoting code reuse.
3. Polymorphism: Objects of different types can be treated as instances of the same type through a common interface.
4. Abstraction: Hiding complex implementation details while showing only essential features.