what is real-time example of runtime polymorphism and
compile time polymorphism
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / shaadaa
GUI Builder Application's Toolbox can be taken as example of runtime polymorphism. we do not know until runtime which tool is going to be selected by user.
Is This Answer Correct ? | 1 Yes | 9 No |
Answer / 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 |
List some important features of java 10 release?
Explain when we should make an instance variable private.
what do you understand by synchronization? Or what is synchronization and why is it important? Or describe synchronization in respect to multithreading? Or what is synchronization? : Java thread
What are E and PI?
How do you join strings in java?
What is an argument java?
What is default switch case? Give example.
I have a Person object with 5 variables and I want to store them in a file called Person.txt. What should I do?
A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.
Is arraylist a class in java?
What are different types of access modifiers?
What do you mean by platform independence? What is an interface?