摘要:
yield是C#为了简化遍历操作实现的语法糖,我们知道如果要要某个类型支持遍历就必须要实现系统接口IEnumerable,这个接口后续实现比较繁琐要写一大堆代码才能支持真正的遍历功能。举例说明usingSystem;usingSystem.Collections.Generic;usingSystem.Collections;usingSystem.Linq;usingSystem.Text;namespace{classProgram{staticvoidMain(string[]args){HelloCollectionhelloCollection=newHelloCollectio.. 阅读全文
posted @ 2012-07-11 11:23
老金
阅读(69007)
评论(7)
推荐(27)
浙公网安备 33010602011771号