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 static methods?
Why are the methods of the math class static?
Can we define private and protected modifiers for the members in interfaces?
Can list be null in java?
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
What is the difference between yielding and sleeping?
How do you declare a string variable?
What is dynamic array in java?
Can a static method be overridden in java?
What does mean in regex?
What is the difference between import java.util.date and java .util?
What is a instance variable?
What is java volatile?
How is abstraction implemented in java ?
Which is better list or arraylist in java?