Chapter 19. Collections

You will find that you have more and more objects to deal with as your program gets bigger and more complex. And, to make things worse, you will find that as you write increasingly complex code, the number of things you can take for granted starts to diminish. In a simple application, you can create arrays to keep track of objects. You know that there will be exactly ten products to track, so you create an array with ten slots. You know which product object will be in each slot, because there are only ten objects. You'll probably have a sticky note on your desk that has the list. Index 0 is this product, index 1 is that product, and so on.

And that's great—until one day you have to deal with 11 products, or 1,000. Or, much ...

Get Introducing Visual C# 2010 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.