Object Oriented Paradigm

Object Oriented Paradigm
Object Oriented Paradigm also called oop is a model for writing computer programs.

Features of OOP
  • Abstraction.
  • Encapsulation.
  • Polymorphism.
  • Inheritance.


Abstraction

Using the essential feature of a programming language  and hiding the complexity is known as abstraction.

Encapsulation
Wrapping of data members & the member function within the class is known as Encapsulation.
It is based on the concept of data hiding & data hiding says that we can't access the private element of class without the help of member function of that class.

Polymorphism
Ability to assume several forms is known as polymorphism and we can achieve polymorphism in C++ by 3 ways.
  1. By function Overloading.
  2. Operator Overloading.
  3. Virtual Function.

Inheritance
It is taken from the real world where the parent class is known as base class and the child class is known as derived class.
It says that child class can access all property of their parent class but parent class can't access the property of child class.

Types of Inheritance
  1. Single inheritance.
  2. Multiple inheritance.
  3. Hierarchical inheritance.
  4. Multi level inheritance.
  5. Hybrid inheritance. 

Comments

Popular posts from this blog

C++ program to print number pyramid 1 121 12321 1234321 using class.

C++ program to print 0 10 010 1010 pattern using class

A simple C++ program using class