- 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;
}
推薦閱讀
- Node.js+Webpack開(kāi)發(fā)實(shí)戰(zhàn)
- .NET之美:.NET關(guān)鍵技術(shù)深入解析
- Docker and Kubernetes for Java Developers
- OpenCV實(shí)例精解
- FLL+WRO樂(lè)高機(jī)器人競(jìng)賽教程:機(jī)械、巡線與PID
- JavaScript動(dòng)態(tài)網(wǎng)頁(yè)開(kāi)發(fā)詳解
- HTML5+CSS3網(wǎng)頁(yè)設(shè)計(jì)
- 深入剖析Java虛擬機(jī):源碼剖析與實(shí)例詳解(基礎(chǔ)卷)
- C指針原理揭秘:基于底層實(shí)現(xiàn)機(jī)制
- Drupal Search Engine Optimization
- Instant GLEW
- 快樂(lè)編程:青少年思維訓(xùn)練
- Java程序設(shè)計(jì)入門(第2版)
- WCF全面解析
- Visual C++程序設(shè)計(jì)全程指南