Professional Documents
Culture Documents
OOP - Polymorphism Concepts
OOP - Polymorphism Concepts
OOP - Polymorphism Concepts
Polymorphism concepts
Polymorphism is the ability to incorporate adaptability of an object to take more than one forms
but the object remains same.
There are two methods of polymorphism in Java. From the implementation point of view, the
polymorphism for the methods is obtained by using the overload and override of the methods
themselves.
Overload: a method where more than one method shares the same name with different
parameter of signature and different return type.
Override: it is based on the writing of several methods identified by the same name which
however have, as input, parameters of a different type and number. Therefore, override means a
real rewriting of a certain method of a class that we have inherited.
Example: