C++ Key Concepts

What is Polymorphism?

posted Nov 8, 2010, 1:53 AM by Thiyagaraaj M   [ updated Jan 20, 2011, 7:54 AM ]

Key Concept:

polymorphism means that some code or operations or objects behave differently in different contexts.
Poly  - Means Many
Morphism Means Forms
Many Forms

Polymorphism

C++ supports several kinds of static (compile-time) and dynamic (run-time) polymorphisms. Compile-time polymorphism does not allow for certain run-time decisions, while run-time polymorphism typically incurs a performance penalty.

PolymorphismTypes:

Compile Time Polymorphism (Static Polymorphism)
Run Time Polymorphism (Dynamic Polymorphism)

Compile Time Polymorphism

Function Overloading
Operator Overloading

Run Time Polymorphism

Inheritance (Hybrid )
Virtual Member Functions


1-1 of 1