Skip to content

Instantly share code, notes, and snippets.

@nanwang2016
Created August 12, 2020 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nanwang2016/22ee5e4603a113b6adb92fa6466b71dd to your computer and use it in GitHub Desktop.
Save nanwang2016/22ee5e4603a113b6adb92fa6466b71dd to your computer and use it in GitHub Desktop.
Method Overloading in C#
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