What is Polymorphism? - C++

What is Polymorphism?

Polymorphism: Poly – Multiple and Morph - Form- Polymorphism means the ability to take more than one form. An operation may exhibit different behavior in different instances. The behavior depends on the types of data used in the operation. For example, consider addition operation. For two numbers, the operation will generation sum. In case of two strings, it will generate a third string with concatenation. Thus, polymorphism allows objects with different internal structure to share same external interface. This means that a general class of operations can be accessed in the same manner even though specific actions associated with each operation may differ.
- There are two types of polymorphism :

Compile Time Polymorphism :
Achieved using operator overloading and function overloading

Rum Time Polymorphism :
Achieved using virtual functions..
What is Inheritance? - C++
What is Inheritance? - Inheritance: One of the most important features of OO design is code-reusability......
Define object, classes and instances.
Define object, classes and instances - Object is the basic run time entity in an Object Oriented (OO) System...
What is multiple inheritance? - C++
What is multiple inheritance? - When a class is derived from another class ie it inherits functionalities of another class, this phenomenon is known as inheritance....
Post your comment