4 Pillars of OOP


Tags:  oopcppjava

These are the four pillars of Object-Oriented Programming:

1. Encapsulation

Encapsulation

2. Abstraction

Stack ADT
public interface StackADT<T>
{
boolean isEmpty();
int size();
void push(T element);
T pop();
T peek();
}

Abstraction and encapsulation support each other. If you don’t group like things together, then you’re going to have a harder time abstracting them. They’ll have to be passing data back and forth.

3. Inheritance

Loading graph...

4. Polymorphism