Method Overloading:

  • It allows a class to have multiple methods with the same name but different parameters.
  • Example: A class Calculator can have methods add(int a, int b) and add(double a, double b).

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *