Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
| 1. | What is the correct way to test for value equality with generics? |
| 2. | What is a type parameter constraint? |
| 3. | What is a closed and open type? |
| 1. | The correct way to test for value equality using generics is to apply the where T : IComparable<T> and use the CompareTo method to perform value equality. |
| 2. | A type parameter constraint is when a generic parameter is used as the constraint for another generic parameter. |
| 3. | An open type is a generic type that has not been supplied any type arguments for its type parameters. A closed type is a generic type that is not open (that is, it has been supplied a type argument for all its type parameters). |