Explain run time , complile time in terms of polymophism

Showing Answers 1 - 9 of 9 Answers

vijay

  • Nov 7th, 2006
 

polymorphism for the public method of an instance is resolved at the run time as the we do not know the type of object of a reference at compile time so call to the function is resolved at runtime and for private method not visible outside the class compile time resolution is done as only method signature need to be checked. so for instance method call , runtime resultion is done for object.method invocation. and for compile time only private and inherited method are resolved.

  Was this answer useful?  Yes

hi_goura

  • Dec 4th, 2006
 

Polymorphism mean "One name, different work" and when this is applied on methods, we are having to versions of usingthe same method name with different functionality. They are "Method Overloading" and "Method Overriding".Method overloading is compile-time polymorphism and method overriding is runtime polymorphism.ThanksGourahari

santh kumar

  • Dec 19th, 2006
 

To say more clearly, After compilation,JVM takes byte code of resource(Proramme). At that time it doesnt know which method is called by which object. In the case of Overloading, JVM knows which methods are called by which Objects.it's nothing but compile time polymorphism. In the case of Overriding , JVM doesnt knows which methods are called by which Objects.it's nothing but run time polymorphism.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions