Sunday, September 13, 2020

Polymorphism in C++

 


C++ Polymorphism

Polymorphism is an important concept of object-oriented programming. It simply means more than one form. That is, the same entity (function or operator) behaves differently in different scenarios. For example,

The + operator in C++ is used to perform two specific functions. When it is used with numbers (integers and floating-point numbers), it performs addition.

int a = 5;

int b = 6;

int sum = a + b;    // sum = 11

 

Inheritance Concept In C++


Inheritance Concept in C++

Inheritance is one of the most important feature of Object Oriented Programming System(OOPs). A class to derive the properties and characteristics from another class is called Inheritance. That means the child class to acquire the properties (the data members and the member functions) of parent class.

Child Class:

A class that inherits properties from another class is known as child class, it is also known as derived class or subclass.

Parent Class:
         The class whose properties are inherited by other class is known as parent class, super class or base class.