Created
August 12, 2020 16:55
-
-
Save nanwang2016/22ee5e4603a113b6adb92fa6466b71dd to your computer and use it in GitHub Desktop.
Method Overloading in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace TestFile | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int resultInt = PlusMethod(1, 2); | |
double resultDouble = PlusMethod(2.4, 4.4); | |
} | |
static int PlusMethod(int a, int b) | |
{ | |
return a + b; | |
} | |
static double PlusMethod(double a, double b) | |
{ | |
return a + b; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment