6.5. Summary

In this chapter, you learned the following:

  • Collections are special types of objects used to gather up and manage references to other objects.

  • An array is a simple, fixed-length collection type that stores elements of a single type.

  • In addition to arrays, the .NET FCL provides other more powerful collection types to draw upon with OOPL, such as the following:

    • Ordered lists

    • Sets

    • Dictionaries

  • Generic collection classes can be used to achieve reusability, type-safety, and efficiency when working with collections.

  • We can work around the limitation that a method can only return one result by having that result be a collection of objects.

  • Declaring a collection of supertypes can be used to make arrays and generic collections more versatile.

Get Beginning C# 2008 Objects: From Concept to Code 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.