• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is polymorphism?

 
vvus bharadwaj
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is polymorphism exactly.I came to know that polymorphism only applies to overiding and polymorphism not applies to static and overloaded methods.What do you mean by this statement.
 
saloni jhanwar
Ranch Hand
Posts: 583
Firefox Browser Notepad Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vvus bharadwaj wrote:What is polymorphism


Polymorphism means one thing have many forms.

vvus bharadwaj wrote: polymorphism only applies to overiding and polymorphism not applies to static and overloaded methods.What do you mean by this statement.


Polymorphism comes in picture only when you do method overriding.

Overload is not overriding, so how will you implement polymorphism there ?

Because you can't override static method so how will you achieve polymorphism there ?



 
Tess Jacobs
Ranch Hand
Posts: 71
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Polymorphism is the ability of an object to take on many forms.

Polymorphism allows a method call to have many possible resolutions.

Run time polymorphism can be implemented through overriding since method calls are resolved at run time.

Compile time polymorphism can be implemented through overloading since method calls are resolved at compile time.
 
Keshav Dussal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Polymorphism in the context of object-oriented programming, is the ability to create a variable, a function, or an object that has more than one form.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i dont know how to explain ploymorphism. but definitely one of the key player of oops/design pattern ;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic