what is real-time example of runtime polymorphism and
compile time polymorphism
Answer Posted / rushugroup
Run time polymorphism: Bank Account, savings and current
(here, acoount class is the base class, savings and current
account are derived classes, the objects of each are created
at runtime)
Compile time polymorphism: 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 ? | 111 Yes | 10 No |
Post New Answer View All Answers
What is nested top-level class?
What does this mean java?
Can we declare an array without size in java?
What is an eror in java?
How do you get the length of a string in java?
What is append in java?
Why convert an applet to an application?
What is the use of bufferedreader?
What does sprintf return?
Explain abstract class in java?
Is main an identifier?
Can an integer be null java?
Explain about the dynamic behavior of core java?
Does it matter in what order catch statements for filenotfoundexception and ioexception are written?
What is the java reflection api? Why it’s so important to have?