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

Which package is imported by default?

633


What is java life cycle?

533


What is diamond operator in java?

495


What is the escape character in java?

509


Is alive and join method in java?

537






What is the base class of all classes?

567


What do you understand by copy constructor in java?

490


What is tree in java?

487


What is visibility mode?

525


Why 1 is not a prime number?

551


What is the benefit of inner classes in java?

604


What is the major drawback of internal iteration over external iteration?

582


Is call by reference possible in java?

531


What do you mean by an object in java?

627


What is public static void main?

565