Polymorphisim in Java

I have just started java and have some problems with understanding polymorphisim
if anyone out there can help me pls send along
code examples are mostly appreciated


  • [b][red]This message was edited by vaibhavdesai at 2002-11-28 22:3:37[/red][/b][hr]
    First of all one thing understand that polymorphism is not many functions with same name and different parameters. and the type of function invoked depends on type of parameters, tat is function overloading. Infact polymorphism is more linked with inheritance. Assume there is parent class and base class inherits parent class. And there is function in both classes with same name even same parameters. but the type of function invoked is decided at runtime by the type of object. if the object is of base class then the function of base class will be called and if the object is of parent class then the parent class object will be called. Check out this link for polymorphism. It is in C++ but has nice explanation.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion