Difference between revisions of "Polymorphism"
From JholJhapata
| Line 1: | Line 1: | ||
| − | Polymorphism meaning "one name many forms", which is also referred to as the third pillar of | + | '''Polymorphism''' meaning "one name many forms", which is also referred to as the third pillar of o'''bject-oriented programming'''. "Poly" means many and "morph" means forms. Polymorphism provides the ability to a class to have multiple implementations with the same name. |
== Types of Polymorphism == | == Types of Polymorphism == | ||
| − | Polymorphism can be static or dynamic. In static polymorphism, the response to a function is determined at the compile time. In dynamic polymorphism, it is decided at run-time. | + | Polymorphism can be static or dynamic. In '''static polymorphism''', the response to a function is determined at the compile time. In '''dynamic polymorphism''', it is decided at run-time. |
== Static Polymorphism == | == Static Polymorphism == | ||
| + | === Static Polymorphism Example === | ||
== Dynamic Polymorphism == | == Dynamic Polymorphism == | ||
| + | === Dynamic Polymorphism Example === | ||
Revision as of 05:31, 15 August 2019
Polymorphism meaning "one name many forms", which is also referred to as the third pillar of object-oriented programming. "Poly" means many and "morph" means forms. Polymorphism provides the ability to a class to have multiple implementations with the same name.
Contents
Types of Polymorphism
Polymorphism can be static or dynamic. In static polymorphism, the response to a function is determined at the compile time. In dynamic polymorphism, it is decided at run-time.