Java Polymorphism
Java Polymorphism
Java Polymorphism
INTRODUCTION:
• “Poly” means many and “Morphs” means forms, So it means many
forms.
• In simple words, we can define polymorphism as the ability of a
message to be displayed in more than one form.
• Perform a single action in different ways.
• Example: A person at the same time can have different characteristics.
Like a man at the same time is a father, a husband, an employee. So
the same person possesses different behavior in different situations.
Types of polymorphism
• In Java polymorphism is mainly divided into two types:
• Compile-time Polymorphism
• Runtime Polymorphism
Compile-time Polymorphism
• Static polymorphism. Function Overloading or Operator overloading.