官术网_书友最值得收藏!

The foreach construct

The foreach loops are new to the language and are used to iterate over a sequence of objects. Even though this is purely syntactic sugar in the language, the foreach loop is widely used when dealing with collections. The foreach loop inherently uses an IEnumerable<object> interface and should only be used for objects implementing this:

foreach (type variable in collection)
{
//statements;
}
主站蜘蛛池模板: 津市市| 扬州市| 胶州市| 永济市| 阳原县| 象州县| 许昌市| 黑龙江省| 五台县| 邵东县| 乌审旗| 铜川市| 舟山市| 自贡市| 承德市| 阿鲁科尔沁旗| 北海市| 石嘴山市| 师宗县| 南开区| 二连浩特市| 新源县| 兴山县| 永川市| 高雄县| 富川| 民和| 尼勒克县| 平乡县| 葫芦岛市| 新民市| 镇宁| 长宁区| 宣威市| 芦山县| 双辽市| 虎林市| 长泰县| 随州市| 宜阳县| 蚌埠市|