Error!
Success!

C# Working With ArrayList: What is the best Iterator choice?

0
kicks

C# Working With ArrayList: What is the best Iterator choice?  (Unpublished)

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."


Kicked By:
Drop Kicked By: