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 the requirement of thread in java?
What was java originally called?
What is the difference between size and length in java?
Why is sizeof not a function?
How garbage collection is done in java?
What is a databasemetadata?
why java uses class level type casting ?
How many bytes is a char in java?
What are computer functions?
What is a boolean output?
how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread
Can you declare the main method as final?
Are arrays passed by reference in java?
What is the difference between keyword and identifier?
How is java hashmap implemented?