How to overload the Main() method in C#
Program.cs
using System;
namespace Kodingwindow
{
    class Program
    {
        public static void Main(string s)
        {
            Console.WriteLine("Welcome to " + s);
        }
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
            Main("Kodingwindow");
        }
    }
}
Output
kodingwindow@kw:~/csharp$ dotnet run
Hello, World!
Welcome to Kodingwindow
kodingwindow@kw:~/csharp$ 
Advertisement