class Program { class CompGen<T> where T : IComparable { public T t1; public T t2; public CompGen(T _t1, T _t2) { t1 = _t1; t2 = _t2; } public T Max() { if (t2.CompareTo(t1)> 0) return t1; else return t2; } } static void Main(string[] args) { CompGen<string> ga = new CompGen<string>("hello ", "World!"); Console.WriteLine(ga.Max()); Console.ReadLine(); } }
t1 < t2
t1 == t2
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)