What is method overloading in C#? Give an example.
What is method overloading in C#? Give an example.
I completed my post-graduation in 2013 in the engineering field. Engineering is the application of science and math to solve problems. Engineers figure out how things work and find practical uses for scientific discoveries. Scientists and inventors often get the credit for innovations that advance the human condition, but it is engineers who are instrumental in making those innovations available to the world. I love pet animals such as dogs, cats, etc.
Ashutosh Kumar Verma
17-Nov-2021Method Overloading in C#:
Method overloading is process in which it allow the programmer to use multiple methods with the same name in same class. But the methods are differentiate with their number and type of argument that passed in methods. Method overloading is a example of Polymorphism of object oriented programming language.
Method overloading can be used with the following point.
• Different number of parameter of methods .
• Different data type of parameter passed in method.
• Different sequence of parameter that passed in method.
Example:
OUTPUT:
8