How do I use Overloading method for this example. When I send an increment, it should give me the new value. If I don’t give an increment, it should add a default value. This is in c# asp.net.
For example:
GetY(y,3) // add 3 to y
or GetY(y) //add default value of 15
Thank you!
You can use an optional parameter to specify a default value, and then overloading isn’t necessary.
This is the same as the following overloaded version: