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
Give the hierarchy of inputstream and outputstream classes.
Can we overload final method in java?
Why destructor is not used in java?
How does singleton class work?
What is double data type?
What is bufferedwriter?
Convert Binary tree to linked list.
Why arraylist is not synchronized in java example?
Write a program in java to create a doubly linked list containing n nodes.
What are nested classes in java?
What is procedure writing?
Implement two stacks using a single array.
Can we use String with switch case?
Explain the difference between private, public, package and protected in java?
What is java regex?