DEV Community

nantha kumar
nantha kumar

Posted on

Polymorphism

What is polymorphism ?

  1. It means the same method name can behave differently based on the object that is calling polymorphism.

Types of Polymorphism ?

  1. Compile-Time Polymorphism (Method Overloading)
  2. Runtime Polymorphism (Method Overriding)

Method overloading :

  1. Method overloading is same method name and different type of arguments or different number of arguments in same class.

Method overriding :

  1. Method overriding is same method signature(method name & arguments) in different class.

Top comments (0)