/// <summary> /// Polymorphic method that computes the maximum value of any pair of IComparable objects /// </summary> /// <returns>The greatest object</returns> static IComparable Max(IComparable a, IComparable b) { return(a.Compare(b) > 0 ? a : b); }
pulbic int ComparePerson(Person person, IComparable comparer) { return(comparer.Compare(this, person)); }
public static object Largest(IComparable a, IComparable b)// this method will work with all classes that implement IComparable regardless of their type { return((a.Compare(b) > 0) ? a : b); }