Skip to content

Instantly share code, notes, and snippets.

@rtipton
Created March 20, 2010 02:51
Show Gist options
  • Save rtipton/338432 to your computer and use it in GitHub Desktop.
Save rtipton/338432 to your computer and use it in GitHub Desktop.
Method Overloading
using System;
namespace MethodOverloading
{
class Program
{
static void Main(string[] args)
{
MethodOverloadPlay(10, 3);
Console.WriteLine("+++++");
MethodOverloadPlay(5, 5, 6);
Console.WriteLine("+++++");
MethodOverloadPlay("SP");
Console.ReadLine();
}
static void MethodOverloadPlay(int number1, int number2)
{
int result = number1 + number2;
Console.WriteLine(result);
}
static void MethodOverloadPlay(int number1, int number2, int number3)
{
int result = number1 + number2 + number3;
Console.WriteLine(result);
}
static void MethodOverloadPlay(string string1)
{
Console.WriteLine("Breaking Benjamin & Sick Puppies Rock!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment