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
Which package is imported by default?
What is java life cycle?
What is diamond operator in java?
What is the escape character in java?
Is alive and join method in java?
What is the base class of all classes?
What do you understand by copy constructor in java?
What is tree in java?
What is visibility mode?
Why 1 is not a prime number?
What is the benefit of inner classes in java?
What is the major drawback of internal iteration over external iteration?
Is call by reference possible in java?
What do you mean by an object in java?
What is public static void main?