Distinction between iterator and enumerator

后端 未结 9 610
南旧
南旧 2020-12-07 08:47

An interview question for a .NET 3.5 job is \"What is the difference between an iterator and an enumerator\"?

This is a core distinction to make, what with LINQ, etc

9条回答
  •  感情败类
    2020-12-07 09:11

    Enumeration deals with objects while iteration deals with values only. Enumeration is used when we use vector hashtable etc while iteration are used in while loop for loop etc. I've never use the yield keyword so I couldn't tell you.

提交回复
热议问题