Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

CHAPTER 3: C# Primer > Collections

Collections

In C#, a collection is a data structure that holds data in an indexed way for ease of storage and retrieval. It can be thought of as a related group of variables that can be accessed individually; examples may include a collection of exam results or a list surnames for a class register. A collection removes the requirement for a separate variable to store each value and most collections provide greatly simplified methods for performing common operations across the collection as a whole, such as sorting, iteration, etc.

Many different types of collection are available to the C# programmer. As I have mentioned before, this chapter has been designed to give you a working knowledge of the language, sufficient only to allow you to progress through the rest of the book, so we will cover just the most commonly used collection types here.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint