Follow us on: facebook twitter linkedin

PROGRAMING

Method Overriding vs Overloading in OOP

Post by : John Deo
Post date: 2024-06-21 13:52:08

Read time : 2 minute
Total views: 276 times
hero-img

Method Overloading

Method Overloading is a feature in OOP where multiple method can have same name within a class but different parameter. Which one give us better readability.

 

We can achieve method overloading

  1. By changing number of the parameters
  2. By changing data type of the parameters.
  3. By changing the order of parameters.

 

Method Overriding

Method Overriding is parent class allow child class use same method for different behavior within child class.This is great OOP feature for better readability and code reusability.

Share by:

Keep exploring

Read what excites, achieves and moves us Read what excites, achieves and moves us