Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Polymorphism

 
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Marshal
Posts: 74372
334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would say, no, overloading doesn't mean polymorphism.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Overloaded methods have different method signatures, making them entirely separate methods. So overloading is not polymorphism.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
author
Posts: 23909
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic