Created
March 20, 2010 02:51
-
-
Save rtipton/338432 to your computer and use it in GitHub Desktop.
Method Overloading
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 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