jae-l
6/12/2017 - 2:45 AM

Example of using overloaded methods. From Fundamentals of Computer Programming with C# http://www.introprogramming.info/wp-content/uploads/2

static void PrintNumbers(int intValue, float floatValue)
{
  Console.WriteLine(intValue + "; " + floatValue);
}

static void PrintNumbers(float floatValue, int intValue)
{
  Console.WriteLine(floatValue + "; " + intValue);
}

static void Main()
{
  PrintNumbers(2.71f, 2);
  PrintNumbers(5, 3.14159f);
  PrintNumbers((float)2, (short)3);
}

//  2.71; 2
//  5; 3.14159
//  2; 3