gregrossdev

Greg Ross

Posted on November 17, 2021

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.

💖 💪 🙅 🚩
gregrossdev
Greg Ross

Posted on November 17, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Access modifiers
beginners Access modifiers

May 2, 2022

Naming matters
beginners Naming matters

March 11, 2022

OOP Principles
beginners OOP Principles

November 17, 2021

Collections
beginners Collections

November 10, 2021