Managing Collections of Objects

Our applications often need to manage data in groups. For instance, we may have a set of similar database records that we want to iterate through, or perhaps we need to sort values in an array. To do so, we typically place this data into a collection for easy management and storage. A collection is simply a class that exposes properties and methods for working with a group of like data. Collection classes often implement standard interfaces that allow us to retrieve, count, and generally order our data in our application.

Depending on our design and requirements, a surprising number of collection strategies are available to us. The Framework Class Library exposes all-purpose collections (such as the ArrayList

Get Visual Basic® Programmer's Guide to the .NET Framework Class Library 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.