What is the difference between run-time Polymorphism and compile-time Polymorphism?

Showing Answers 1 - 2 of 2 Answers

sainath

  • Jul 7th, 2006
 

compile time polymorpism also known as staic poly

run time polymorpism also known as dynamic polymorpism

example for static poly is method overloading

example for dynamic poly is method overriding

static poly is linking method call at the time of compilation time

dynamic poly is linking method call at the time of runing time

  Was this answer useful?  Yes

Vinit Jain

  • Sep 8th, 2006
 

When we are implementing function overloading in java, the call for that method is getting resolved at compile time. That is when our .class file is created that calls are already resolved.

If you consider function overriding, the call for that method is getting resolved at runtime. That means if you read the byte code the call for the method is not resolved.

  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