why java does compile time polymorphism at run time ?

Answer Posted / sarbbottam bandyopadhyay

compile time polymorphism is nothing but dynamic binding.
For overloaded method java uses static binding.
For overridden method Java uses dynamic binding.
Weather the method of the base class or the method of parent class will get invoked depend on the method invocation. i.e. which object is invoking the method, which class this object is an instance of.

Refer the below link.
http://download.oracle.com/javase/tutorial/java/IandI/polymorphism.html

Is This Answer Correct ?    5 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can interface be private in java?

774


What are the data types supported by java? What is autoboxing and unboxing?

781


Does java support multiple inheritance or not?

830


Can I override protected method in java?

824


Is there any case when finally will not be executed?

734


Can we execute a program without main?

768


why using interface interface ?

1785


What is break and continue statement?

812


What is matcher in java?

745


What is the difference between static method and instance method in Java?

847


How would you format a date in java? I.e. In the ddmmyyy format?

1150


What are the 6 functions?

738


What are the four pillars of java?

911


What is method in java with example?

714


Does A Class Inherit The Constructors Of Its Superclass?

790