File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between polymorphism and inheritance

 
jo sim
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I know about overriding, overloading, extending classes. I just dont know the difference between polymorphism and Inheritance.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See How my dog learned polymorphism, and let us know if that clears it up.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47232
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sort of question comes up frequently; you can get answers by searching. I wrote about it myself about a week ago here.

Polymorphism is one of the features or results of inheritance.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Campbell Ritchie:

Polymorphism is one of the features or results of inheritance.


That's not true. What is true is that *in Java* polymorphism is coupled to inheritances. But there are languages that provide polymorphism without the need for inheritance; and there are other languages that have inheritance without polymorphism.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic