Skip to content

PRO TIP Block youtube.com at the DNS level โ€” Pi-hole, NextDNS or your hosts file โ€” but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

C# method overloading ๐Ÿคฏ

55.5K views on YouTube

C# method overloading tutorial example explained

#C# #method #overloading

using System;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{
// method overloading = methods share same name, but different parameters
// name + parameters = signature
// methods must have a unique signature

double total;

total = Multiply(2, 3, 4);

Console.WriteLine(total);
Console.ReadKey();
}

static double Multiply(double a, double b)
{
return a * b;
}
static double Multiply(double a, double b, double c)
{
return a * b * c;
}
}
}