What is Dynamic Polymorphism?

Answer Posted / karthikeyan srinivasan

Polymorphism : Same function name but with different behaviors
Related Concepts : functional overriding and functional
overloading

Dynamic Polymorphism(Run time polymorphism) :
The decision of selecting which function has to be run
in run time is dynamic polymorphism
Ex:
class A {
function write() {
// Base class write method
}
}
class B extends A {
function write() {
// Derived class method
}
}
Called dynamic binding.

Compile time polymorphism:

Functional overloading is compile time polymorphism.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is solid in oops?

612


What is the full form of oops?

612


Prepare me a program for the animation of train

2000


What is a class oop?

594


How Do you Code Composition and Aggregation in C++ ?

24201






write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.

1780


What is balance factor?

589


What is an example of genetic polymorphism?

651


What is the purpose of enum?

583


What is purpose of inheritance?

645


INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?

1637


write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).

1642


What is difference between polymorphism and inheritance?

617


What is the point of oop?

656


Write a program to reverse a string using recursive function?

1792