Why do we need iterators in c#?

前端 未结 10 1892
情话喂你
情话喂你 2021-02-05 18:35

Can somebody provide a real life example regarding use of iterators. I tried searching google but was not satisfied with the answers.

10条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 19:34

    Iterate through a set of homework questions.

    But seriously, Iterators can provide a unified way to traverse the items in a collection regardless of the underlying data structure.

    Read the first two paragraphs here for a little more info.

提交回复
热议问题