The-definition.com

Definition

Polymorphism

In object-oriented programming, Polymorphism means the ability to use same named method (function) or operator in different ways.

Also,

The ability that allows an operator or function to respond differently when supplied with arguments that are objects of different types is called polymorphism.

 In other words, polymorphism allows you define one interface and have multiple implementations. 

This technique of OOP is achieved in different ways such as method overriding, method overloading, and operator overloading.

Example:

Method overloading. (define two or more methods of same name in a class with different number of arguments).

Java Code: 

class Overload
{
    void demo (int a)
    {
       System.out.println (a);
    }
    int demo (int a, int b)
    {
       return a*b;
    }
}

class MethodOverloading
{
    public static void main (String args [])
    {
        Overload Obj = new Overload();
        Obj.demo(10);
        int result=Obj.demo(10, 20);
     
        System.out.println(result);
    }
}

Polymorphism is the process of passing through different bodily forms in the course of an organism's development, as in a frog or butterfly.

Webster Dictionary Meaning

1. Polymorphism
- Same as Pleomorphism.
- The capability of assuming different forms; the capability of widely varying in form.
- Existence in many forms; the coexistence, in the same locality, of two or more distinct forms independent of sex, not connected by intermediate gradations, but produced from common parents.
Share it:  Cite

More from this Section

  • Playing Hard to Get
    Playing Hard to Get efforts to increase compliance by suggesting that a person or object ...
  • Proportion of Similar Attitudes
    Proportion of Similar Attitudes is the number of topics on which two individuals hold ...
  • Halo horn effect
    Halo/horn effect is a form of interviewer bias, occurring when the interviewer rates or ...
  • Cerebral dominance
    Cerebral dominance is the tendency for one cerebral hemisphere or the other to be dominant ...
  • Megalomaniac
    Megalomaniac is a person with a mania for himself, having a wildly exaggerated view of ...