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 is covariant return type?
How do you check if an arraylist is not empty?
There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?
How can you add and remove nodes in jtree?
What string is utf8?
Explain about abstract classes in java?
Which sorting algorithm is best in java?
What is an empty class? What functionality does it offer in Java?
What is array length?
Can a variable be local and static at the same time?
What is a website container?
What will happen if a thrown exception is not handled?
What is a flag value?
What are keywords in java?
Where import statement is used in a java program?