- Hands-On Object:Oriented Programming with C#
- Raihan Taher
- 68字
- 2021-07-02 12:44:36
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;
}
推薦閱讀
- Reporting with Visual Studio and Crystal Reports
- 垃圾回收的算法與實(shí)現(xiàn)
- Neo4j Essentials
- Groovy for Domain:specific Languages(Second Edition)
- Apache Karaf Cookbook
- C語言程序設(shè)計(jì)同步訓(xùn)練與上機(jī)指導(dǎo)(第三版)
- WebRTC技術(shù)詳解:從0到1構(gòu)建多人視頻會(huì)議系統(tǒng)
- INSTANT Sinatra Starter
- Yii Project Blueprints
- C#程序設(shè)計(jì)教程(第3版)
- Java Fundamentals
- Flowable流程引擎實(shí)戰(zhàn)
- 軟件體系結(jié)構(gòu)
- Mastering Apache Camel
- Python應(yīng)用與實(shí)戰(zhàn)