solulubeta
Sign in
Cheat Sheets / CS Theory
01.04 · Cheat sheet

OOP

The four pillars, overloading vs overriding, abstract class vs interface, access modifiers, constructors, key keywords, relationships and SOLID on one page.

3 min Cheat sheet Pro

Object-oriented programming in Java and C++, the way interviewers ask it.

The four pillars

  • Encapsulation: hide the data, expose methods (private fields + getters and setters).
  • Abstraction: show what it does, hide how (abstract classes, interfaces).
  • Inheritance: reuse code through an is-a link (extends).
  • Polymorphism: one name, many forms (overloading and overriding).

Overloading vs overriding

OverloadingOverriding
WhereSame classSubclass
SignatureDifferent parametersSame signature
Decided atCompile timeRun time
Return typeCan differSame (or a subtype)
solulu Pro

Continue this cheat sheet with Pro

Inside: 9 sections.

  • The four pillars
  • Overloading vs overriding
  • Abstract class vs interface (Java)
  • Access modifiers (Java)
  • Constructors
  • Keywords
  • +3 more
Lifetime ₹1,999 ₹999 · Launch offer
Mark this as done when you are finished.

Item 4 of 12 · updated 2026-10-13