C++ Programming Language Tutorial Hindi 71 Polymorphism

This video is made for learning about Polymorphism in C++ Programming Language Tutorial in Hindi.

In object-oriented programming, polymorphism refers to a programming language’s ability to process objects differently depending on their data type or class. More specifically, it is the ability to redefine methods for derived classes.

Polymorphism

“Poly” is Greek word means many, and “morph” means form.

Types:
1. Compile Time Polymorphism
i. Function Overloading
ii. Operator Overloading
2. Run Time Polymorphism
i. Virtual Function

Method overloading should not be confused with forms of polymorphism where the correct method is chosen at runtime, eg through virtual functions, instead of statically.

If a function denotes different and potentially heterogeneous implementations depending on a limited range of individually specified types and combinations, it is called ad hoc polymorphism. Ad hoc polymorphism is supported in many languages using function overloading.
If the code is written without mention of any specific type and thus can be used transparently with any number of new types, it is called parametric polymorphism. In the object-oriented programming community, this is often known as generics or generic programming. In the functional programming community, this is often simply called polymorphism.
Subtyping (or inclusion polymorphism) is a concept wherein a name may denote instances of many different classes as long as they are related by some common superclass.] In object-oriented programming, this is often referred to simply as polymorphism.

source