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

what is the difference between a threads start() and run() methods? : Java thread

518


How to perform quicksort in java?

561


What happens if we override private method?

521


Does importing a package imports its sub-packages as well in java?

552


What is final keyword?

639






What is square root in java?

584


What is the ==?

461


What classes of exceptions may be caught by a catch clause in java programming?

698


What are different types of encoding?

578


Why main() method is public, static and void in java ?

591


What is an association?

544


What are extraneous variables examples?

521


What is singleton class in java and how can we make a class singleton?

568


How do you define a singleton class?

507


Does java support multiple inheritances?

556