• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Polymorphism

 
jose chiramal
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i say overloading as a form of polymorphism ? I know of the below three forms of polymorphism :
Method overriding
– Methods of a subclass override the methods of a
superclass
● Method overriding (implementation) of the abstract
methods
– Methods of a subclass implement the abstract methods
of an abstract class
● Method overriding (implementation) through the
Java interface
– Methods of a concrete class implement the methods of
the interface

 
Campbell Ritchie
Sheriff
Posts: 48374
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would say, no, overloading doesn't mean polymorphism.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Overloaded methods have different method signatures, making them entirely separate methods. So overloading is not polymorphism.
 
Ulrika Mingle
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jose chiramal wrote:Can i say overloading as a form of polymorphism ?


Sure there are 4 kinds of polymorphisms in the Java type system: Overloading, overriding, coersion and generics.
 
Charles Owen
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Polymorphism is basically Greek for "many forms." In OOP, it basically means a type or object can take on many forms. A parent class can take on the form of a derived class and vice versa. For example, you could have a Animal base class, and a Tiger derived class.

 
Henry Wong
author
Marshal
Pie
Posts: 20881
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Personally, I would say no -- that overloading is not really polymorphism. But, there are many definitions. And I have seen some sites that say yes, that it is a certain type of polymorphism.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic