Object-Oriented Programming (OOP) is a way of building programs by modeling real-world objects. For example, you write Student, Product, Car, Order, User, etc. as classes, and keep each one's data and behavior bundled together in one place.
The 4 pillars of OOP
- Encapsulation — keeping data safely under control
- Inheritance — one class picking up features from another
- Polymorphism — letting the same method behave differently depending on context
- Abstraction — hiding away details you don't need to see
Why bother with OOP
- It lets you organize your code with a solid project structure.
- It cuts down on repeated code.
- It makes big systems easier to manage by splitting them into modules.
- It lets you model real business logic more closely.
Summary
🧠 Simple idea
Think of a class as a recipe card, and an object as an actual dish cooked from that recipe. Just as one recipe can produce many dishes, one class can create many objects.