DEV Community

Cover image for OOP Principles
Greg Ross
Greg Ross

Posted on • Updated on

OOP Principles

oop outline

Building Blocks



An object is an entity that has states and behaviors.


A class is a template or blueprint from which objects are created.

Main Principles



Encapsulation is a process of wrapping code and data together into a single unit.


Inheritance is a mechanism in which one object acquires all the states and behaviors of a parent object.


Abstraction is a process of hiding the implementation details and showing only functionality to the user.


An interface is a blueprint of a class.


Polymorphism is the ability of an object to take on many forms.

Method overloading

If a class has multiple methods that have same name but different parameters, this is known as method overloading.

Method overriding

If a subclass has the same method as declared in the super class, this is known as method overriding.

Top comments (1)

enriqueedelberto profile image
Edelberto Enrique Reyes

Thanks for sharing. It's really interesting.