Working with Groups of Items

A common scenario in computer programming is managing a group of similar items. For example, you might need to work with a set of values, such as ZIP codes to which a sales representative is assigned. Alternatively, you might need to work with a group of objects such as the paychecks an employee has received in a given year. In cases where you need to work with a group of elements you can do so using an array or a collection class. The former is great for working with a set, sequential list of items of the same type. The latter is more applicable for managing a variable sized group of objects.

Arrays

An array is a group of items of the same type (either value or reference types). For instance, you might create an ...

Get Microsoft® Visual Studio® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.