What is Method Overloading?
What is Method Overloading?
What is Method Overloading?
Method Overloading means having two or more methods with the same name but different signatures in the same scope. These two methods may exist in the same class or one in base class and another in the derived class.
The signature of a function is determined by 3 factors:
a) Number of arguments received by the function.
b) Data types of the parameters/arguments.
c) Position/order of the arguments.
The signature of a function never depends upon the return type. Two functions differ only in their return type cannot be overloaded.
Thanks & Regards
Paritosh Mohapatra
When we are overloading a method of the base class in derived class are know as Method overloading . Method overloading allows us to write different version of the same method in a class or derived class. Example of overloaded methods in C Sharp