Method Overloading
Create different versions of the same method.
We'll cover the following...
Overload a method
Sometimes, we might need to create a method that, depending on the type and number of parameters, will perform a slightly different set of actions.
Suppose we have a method called Multiply()
that takes two numbers and multiplies them. What if we need the same method to accept not two, but three numbers?
That’s where method overloading comes into play.
Method signature
In C#, we can create several methods that have the same name but differ in other portions of its signature. Method signature consists of several parts:
- Method name
- Parameter quantities
Access this course and 1400+ top-rated courses and projects.