Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Object Oriented Programming: Basic concepts

The for main pillars of Object Oriented Programming are as mentioned below:

  1. Encapsulation
  2. Polymorphism
  3. Inheritance
  4. Abstration
Below is the explanation about these concepts:

1) Encapsulation:


It is a kind of capsule or container which encapsulate data and methods. It is concept of hiding all the information except the information which is really required to expose to other Classes or objects. In this way you would not need to take care of doing change in multiple places when you do the changes in your container data and methods. And you also can hide the private information which you are not supposed to expose to others.

2) Polymorphism:

Polymorphism means multiple forms. Different classes might define same method with different properties or same properties.

3) Inheritance:

Inheritance is the way to inherit the properties and methods from superclass or another classes.

4) Abstraction:

Abstraction means essential qualities of the idea rather then all the information. It only focus on essential information. It does not focus on other unnecessary or extra information. For example, if there are bank accounts of multiple users with the information like account number, balance, opening date and other details. We will not create classes for each customers. Rather, we will create bank account class with only necessary information.


This post first appeared on Frontend Skills, please read the originial post: here

Share the post

Object Oriented Programming: Basic concepts

×

Subscribe to Frontend Skills

Get updates delivered right to your inbox!

Thank you for your subscription

×