Method Overloading in C#

Method Overloading means that you can have different methods having the same code, but with different parameters. Here is an example:

class MyMath{    public static int Add(int number1, int number2)    {        return Add(number1, number2, 0);    }    public static int Add(int number1, int number2, int number3)    {        return number1 + number2 + number3;    }}
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Related Posts