Showing posts with label Polymorphism in java. Show all posts
Showing posts with label Polymorphism in java. Show all posts

What is polymorphism?

Polymorphism is the process of “an object can exhibit different type of  behavior at different instances.”
This polymorphism has 2 types.


1.      Function overloading :
The process of defining multiple methods “with same name and different signatures(parameter type/list)”                                    Or
A class can have more than one function “with same name and different signatures(parameter type/list)”

2.      Function overriding:
The process “redefining super class methods into sub classes” called function overriding
                                                            Or
A class can have more than one function “with same name and same signatures(parameter type/list)”.