Why does IEnumerable<T> inherit from IEnumerable?
问题 This might be a old question: Why does IEnumerable<T> inherit from IEnumerable ? This is how .NET do, but it brings a little trouble. Every time I write a class implements IEumerable<T> , I have to write two GetEnumerator() functions, one for IEnumerable<T> and the other for IEnumerable . And, IList<T> doesn't inherit from IList. I don't know why IEnumerable<T> is designed in other way. 回答1: Straight from the horse's mouth (Hejlsberg): Ideally all of the generic collection interfaces (e.g.