Computer Applications

What is meant by method overloading? In what way it is advantageous?

User Defined Methods

45 Likes

Answer

Method overloading is the process of defining functions/methods within a class, that have the same name but differ in the number and/or the data types of their arguments.

The advantages of method overloading are:

  1. Method overloading is one of the ways in which Java implements the object oriented concept of Polymorphism.
  2. With method overloading, programmers don't have to create and remember different names for functions doing the same thing for different data types.

Answered By

25 Likes


Related Questions