DEV Community

Cover image for OOP Principles
Greg Ross
Greg Ross

Posted on • Updated on

OOP Principles

oop outline

Building Blocks

-

Objects

An object is an entity that has states and behaviors.

Classes

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


Main Principles

-

Encapsulation

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

Inheritance

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

Abstraction

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

Interface

An interface is a blueprint of a class.

Polymorphism

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)

Collapse
 
enriqueedelberto profile image
Edelberto Enrique Reyes

Thanks for sharing. It's really interesting.