What are the different types of polymorphism?

Answer Posted / mms zubeir

There are two types of polymorphism.
1. Adhoc polymorphism (Overloading, templates).
2. Parametric polymorphism(Overriding).

If the behaviors are finite and known before its usage, it
is adhoc polymorphism. These bindings are done at
compilation itself and hence called compile time binding.

If the behaviors are infinite and known only at run time at
the time of use, it is parametric polymorphism. These
binding can be mapped at run time only and hence sometimes
referred as run time binding.

Note:- Virtual mechanism is used to resolve conflicts in
overriding polymorphically. Virtual mechanism itself
doesn't provide any polymorphism rather the overriding
leads to run time polymorphism.

Is This Answer Correct ?    4 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you obtain segment and offset addresses from a far address of a memory location?

622


What is a map in c++?

587


Why do we use classes in programming?

578


Can we declare a base-class destructor as virtual?

588


Can you sort a set c++?

532






What is the size of integer variable?

598


What is the need of a destructor?

640


What is the use of volatile variable?

602


How do I write a c++ program?

598


explain the reference variable in c++?

580


What is ctime c++?

581


what is a class? Explain with an example.

621


Why do we need templates?

542


Is it possible to pass an object of the same class in place of object reference to the copy constructor?

572


When are exception objects created?

613