Method Overload (Named Arguments)

CSharp · Console

/Program.cs

using System;
					
public class MathStuff
{
  static int Square(int a)
  {
    int square = a * a;
	Console.WriteLine("Called Square(int a)");
	return square;
  }

  static double Square(double b)
  {
    double square = b * b;
	Console.WriteLine("Called Square(double b)");
    return square;
  }
	
  public static void Main()
  {
    Console.Write("Square of 9 is {0}", Square(b: 9));
  }
}
;