Hello guys......
I am confuse in what is the difference between Enumerator and Enumerable?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sujeet SumanRank #790 · 2.9K reputationPosted Oct 1, 2015, 8:22 AM EDT
Sumit JoshiRank #1,252 · 1.4K reputationPosted Oct 1, 2015, 11:17 AM EDT
IEnumerableinterface should implement a methodGetEnumeratorwhich returns a type that implements theIEnumeratorinterface. Then having an enumerator you can use theforeachstatement, which in its essence implements theiteratorpattern, to traverse the elements of a collection of your custom type.