In this section, we present a generic
Maximum method that determines and returns the largest of its three arguments (all of the same type). The generic method in this example uses the type parameter to declare both the method’s return type and its parameters. Normally, when comparing values to determine which one is greater, you would use the
> operator. However, this operator is not overloaded for use with every type that’s built into the Framework Class Library or that might be defined by extending those types. Generic code is restricted to performing operations that are guaranteed to work for every possible type. Thus, an expression like
variable1 < variable2 is not allowed unless the compiler can ensure that the operator ...