# Object-Oriented Programming (OOP) Confidence: high Last verified: 2026-05-22 Generation: human_only ## TL;DR OOP organizes code around objects (data + behavior) rather than functions. Four pillars: Encapsulation (hide internals), Inheritance (reuse through hierarchy), Polymorphism (same interface, different behavior), Abstraction (simplify complex reality). Languages: Java, C++, Python, C#, Ruby. ## Core Explanation Encapsulation: private fields, public methods — protects data integrity. Inheritance: `class Dog extends Animal` — code reuse but can create fragile hierarchies. Polymorphism: `animal.speak()` works differently for Dog vs Cat. Composition over inheritance: has-a vs is-a — more flexible. SOLID principles (Robert C. Martin) guide good OOP design. ## Further Reading - [Object-Oriented Analysis and Design (Booch)](undefined)