static void Main(string[] args) { Generics3 <string> g3 = new Generics3 <string> (); g3.display("hello", "guys"); Generics31 <int> g31 = new Generics31 <int>(); g31.display(21, 2121); Generics31 <double> g32 = new Generics31 <double>(); g32.display(11.1, 22.2); Console.Read(); }
static void Main(string[] args) { //Generic on method Generics1 g1 = new Generics1(); bool result = g1.Compare <int>(10, 25); Console.WriteLine(result); Generics2 g2 = new Generics2(); g2.Add <float>(10.4f, 20.50f); g2.Sub <float>(12.25f, 65.0f); //Generic on Class Generics3 <float> g3 = new Generics3 <float>(); g3.Add(10.6f, 2.2f); g3.Sub(25f, 25.4f); }