Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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
Thanks

Comments

  • vaibhavdesaivaibhavdesai Posts: 3Member
    [b][red]This message was edited by vaibhavdesai at 2002-11-28 22:3:37[/red][/b][hr]
    hi
    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.
    http://trinetra.ncb.ernet.in/~manu/cplusplus/cplusplus14.html

    cheers
    vaibhav




Sign In or Register to comment.