3 questions :
1) why does the out put is taken from the NON generic function ?
2) why do I have to implement ALSO the NON generic function ?
3) What do I need to do if i want to see the Generic function output ( the int’s) ?

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
foreachkeyword does not require the collection to implementIEnumerableat all; rather, it will call any definedGetEnumeratormethods.IEnumerable<T>implementsIEnumerablefor compatibility reasons.You should implement
IEnumerable.GetEnumerator()explicitly and have the normal method returnIEnumerator<T>.If the class has a normal
GetEnumerator()method (as opposed to an explicit interface implementation), the compiler will call it.The spec says: