Part of my 2025 Job Search is getting asked a lot of questions about OOP specifics, so this is a little Study Guide for myself. I also feel like I struggle diagramming code, so I’m going to try and do mermaid diagrams for every concept.
The four pillars of OOP
Inheritance
Making a common class that has common attributes or methods that are shared.
classDiagram Mammal: +int age Mammal: +int legs Mammal <|-- Duck Mammal <|-- Horse class Duck { +swim() +quack() } class Horse { +bool is_wild +bool tame() +gallop() }
In this example Duck
and Horse
are both inheriting age
and legs
from Mammal
.