Coding & Programming > Programming Forum

What is polymorphism?

(1/2) > >>

chinmay.sahoo:
Poly stands for “many” and morph stands for “form”.   It simply means the ability of an object to take more then one form.

SeoDezin:
Polymorphism is an object- oriented programming concept that refers to the ability of a variable , function or object to take on multiple forms .A language that features polymorphism allows developers to program in the general rather than program in the specific.

Lauraponting:
Polymorphism in Java:
Polymorphism in java is a mechanism  which we can perform a single action by different ways.
 "poly" means many and "morphs" means forms.
There are two types of polymorphism in java: compile time polymorphism and runtime polymorphism.
We can perform polymorphism in java by method overloading and method overriding.
If you overload static method in java, it is the example of compile time polymorphism.
Runtime polymorphism or Dynamic Method Dispatch is a process in which a call to an overridden method is resolved at runtime rather than compile-time.

richardmsmith:
polymorphism in Java:
The word "poly" means many and "morphs" means forms. So polymorphism means many forms.
There are two types of polymorphism in Java: compile-time polymorphism and runtime polymorphism. We can perform polymorphism in java by method overloading and method overriding.

EugeneHill:
Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.
For instance, suppose there is a class called Animal, and a class called Dog that inherits from Animal.

Polymorphism is the ability to treat any Dog object as an Animal object like so:
Dog* dog = new Dog;
Animal* animal = dog;

Navigation

[0] Message Index

[#] Next page

Go to full version