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


Please Help Members By Posting Answers For Below Questions

Write an algorithm program in java for the following question.. In a VLSI design techniques,they used rectangles to design circuits. EVery rectangle is to be placed according to x,y coordinates. Check whether or not two rectangles overlap each other. Here overlapping of rectangles is acceptable, if 1) one rectangle intersect with other. 2) one rectangle fully covers other. The time of algorithm should not exceed o(n logn).

2230


How do you check if a string is lexicographically in java?

498


What are the different types of inheritance in java?

529


What is the function of character?

522


What access modifiers can be used for methods?

555






What are the types of literals?

556


What is a treeset class?

558


What is double word?

531


What is computer compiler?

533


What is codebase?

532


Have you ever used hashtable and dictionary?

570


Is minecraft 1.15 out?

545


What is the use of hashmap in java?

547


Explain tree set and its features?

597


how we can create packages in java?

516