what is real-time example of runtime polymorphism and
compile time polymorphism

Answer Posted / harish kumar

Run time polymorphism : function and Operator overloading is
a runtime polymarphism. Example:- Bank Account, savings and
current(here, account class is the base class, savings and
current account are derived classes, the objects of each are
created at run time)

compiler time polymorphism : virtual function is a compiler
time polymorphism. Example:- calculating area of square and
rectangle (different classes, square and rectangle have a
function called area() which takes different arguments (for
square only one argument and for rectangle two arguments-) )

Is This Answer Correct ?    11 Yes 55 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of java?

778


Can an object subclass another object?

800


What is the instance of an object?

868


Is call by reference possible in java?

744


What is toarray method in java?

793


What does you mean in math?

801


Can list be final in java?

706


Why java is a platform independent? Explain

777


Is arraylist a class in java?

777


What is instance example?

737


what do you mean by stream pipelining in java 8? Explain

787


What does the exclamation mark mean in java?

950


Is static a keyword in java?

742


Can we synchronize static methods in java?

823


Is age discrete or continuous?

899