码迷,mamicode.com
首页 > 其他好文 > 详细

foreach遍历

时间:2014-10-23 12:00:00      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:for   sp   bs   方法   nbsp   ld   c   ie   遍历   

想要实现Foreach遍历循环

1.需要让该类型实现一个名字叫IEnumberable的接口,

实现该接口的目的是实现 GetEnumerator方法。

 

GetEnumerator() 这个方法就是获取一个“枚举器”

枚举器 实现IEnumberator

 

foreach遍历

标签:for   sp   bs   方法   nbsp   ld   c   ie   遍历   

原文地址:http://www.cnblogs.com/DJYBlog/p/4045312.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!