What is the difference between runtime polimorphism, and compiletime polimorphism ?

Questions by sadashivarao   answers by sadashivarao

Showing Answers 1 - 7 of 7 Answers

Saurabh Raisinghaney

  • May 3rd, 2006
 

Run time polymorphism is achived when we can come to know the class which executes the method class only at run time and not before that. For eg: the command pattern is a very good eg. of runtime polymorphism

  Was this answer useful?  Yes

Vinod

  • May 4th, 2006
 

Run time polimorphism means function call is resolved at run time.It means which function code will execute in response to a perticular function call is not known till execution of program.ex- Funtion overriding.

Compile time polimorphism means function call is resolved at compile time.It means which function code will execute in response to a perticular function call is known to compiler at compile time.example- Function overloading

  Was this answer useful?  Yes

Vijay Jadhao

  • May 4th, 2006
 

Compile time polymorphism:  In this the linking between method call & method definition takes place at compile time.It means at compile time only, compiler decides where to jump to execute the method body.

Advantage : Faster execution of code.

Disadvantage: The size of compiled code is high.

Run time polymorphism: In this the linking between method call & method definition takes place at execution time.It means at run time , Java virtual machine(In case of Java) decides where to jump to execute the method body.

Advantage : Slower execution of code.

Disadvantage: The size of compiled code is less.

  Was this answer useful?  Yes

vani.rao.s

  • May 4th, 2006
 

Runtime polymorphism means  overriding using inheritance - (same method name, same parameter list, same return type, same or higher visibility, same or less or child exceptions (may add runtime exceptions))

Compile-time polymorphism means  Overloading (- same method name, different parameter list)

  Was this answer useful?  Yes

Srikanth

  • May 12th, 2006
 

runtime poly morphism is resolved at runtime i.e the reference variable actually cares which object its presently pointing tocompile time polymorphish is resolved at compile time i.e the reference variable actually cares which type of object its actually rather than which object its pointing

  Was this answer useful?  Yes

rajev

  • May 25th, 2006
 

good

  Was this answer useful?  Yes

ganesh

  • May 25th, 2006
 

  1. runtime poly morphism is resolved at runtime i.e the reference variable actually cares which object its presently pointing tocompile time polymorphish is resolved at compile time i.e the reference variable actually cares which type of object its actually rather than which object its pointing

  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