New C# Features in the .NET Framework 4-Covariance and Contravariance

Covariance and Contravariance Covariance and contravariance are best introduced with an example, and the best is in the framework. In System.Collections.Generic, IEnumerable<T> and IEnumerator <T> represent, respectively, an object that’s a sequence of T’s and the enumerator (or iterator) that does the work of iterating the sequence. These interfaces have done a lot of heavy … Read more New C# Features in the .NET Framework 4-Covariance and Contravariance