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 an objects lock and which objects have locks? : Java thread

782


What type of language is java?

759


What are the advantages and disadvantages of reference counting in garbage collection?

779


What are the different http methods?

733


What is functional interface in java example?

765


What is method reference in java?

820


When can you say a graph to be a tree?

841


what is the difference between the methods sleep() and wait()? : Java thread

729


Why singleton pattern is better than creating singleton class with static instance?

788


What is the ==?

675


Why is core java important?

787


What do you mean by scope of variable?

666


Does variable declaration allocate memory?

790


What are the 6 mandatory procedures for iso 9001?

736


Convert Binary tree to linked list.

835