using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CallingGernics { class Program { static void Main(string[] args) { MyClassToDemoCalls obj = new MyClassToDemoCalls(); obj.Method1(10, 20); obj.Method1(10, 20); // obj.Method1(10, 20); // This call is ambiguous. obj.Method1(10, 20); obj.Method1(3.14, 20); // obj.Method1(10, 20L); // This call is also ambiguous. Console.ReadLine(); } } public class MyClassToDemoCalls { public void Method1(int arg1, T arg2) { Console.WriteLine("Hello from Method1(int, T) where T is {0}.", typeof(T)); } public void Method1(T arg1, long arg2) { Console.WriteLine("Hello from Method1(T, long) where T is {0}.", typeof(T)); } } }