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
What are the advantages of java?
Can an object subclass another object?
What is the instance of an object?
Is call by reference possible in java?
What is toarray method in java?
What does you mean in math?
Can list be final in java?
Why java is a platform independent? Explain
Is arraylist a class in java?
What is instance example?
what do you mean by stream pipelining in java 8? Explain
What does the exclamation mark mean in java?
Is static a keyword in java?
Can we synchronize static methods in java?
Is age discrete or continuous?