C# Working With ArrayList: What is the best Iterator choice?(coderpaws.blogspot.com)
submitted by
CoderPaws(140) 1 year, 8 months ago
When you first look at which statement to use to iterate through an ArrayList collection, the foreach statement stands out. It's syntax is concise and readable as well as no extra lines of code are needed to extract the element you want to work with. But...[pause for effect]...if the collection is changed (e.g. adding, modifying, or deleting elements and even copying to it), you'll get a runtime error that the "Collection was modified."
|category: C#
|Views: 346
tags:
csharp Iterator C-Sharp ArrayList C# another
Everyones tags:
Your Tags: