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

What is format for defining a structure?

685


what is Loop function? What are different types of Loops?

735


What are the different types of polymorphism in c++?

704


When is dynamic checking necessary?

676


What is a node class in c++?

733






Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300”,”BullCart : 10”) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side

3136


Explain class invariant.

675


what kind of projects are suitable for c and c++

712


What language does google use?

693


Difference between struct and class in terms of access modifier.

800


How would you implement a substr() function that extracts a sub string from a given string?

662


What is the purpose of the "delete" operator?

705


What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal

807


What is the use of object in c++?

686


Can I learn c++ without knowing c?

684