Java Polymorphism

  • Post author:
  • Post category:Java / Java OOP
  • Post last modified:July 7, 2021
  • Reading time:1 mins read

If one task is performed in different ways, it is known as polymorphism. For example: to convince the customer differently, to draw something, for example, shape, triangle, rectangle, etc.

In Java, we use method overloading and method overriding to achieve polymorphism.

Inheritance lets us inherit attributes and methods from another class. Polymorphism uses those methods to perform different tasks. This allows us to perform a single action in different ways.

Code_here