10
When I implement IList<T>, I find that I am required to define two GetEnumerator methods. One returns a value that is of type IEnumerator, while the other returns IEnumerator<T>.
I'm a little confused about the difference between these two GetEnumerator methods. While the return types are obviously different, don't they essentially hold the same data?
In addition, why is it that both versions of GetEnumerator can exist as methods when they differ only by return type? This seems to violate the rule in C# which specifies that overloaded methods cannot differ only by return type.