Collections

Arrays are the most popular kind of collection. However, the .NET FCL offers a variety of other collections with different semantics. Collections are abstractions of data algorithms. ArrayList abstracts a dynamic array; the Stack collection abstracts a stack data structure; the Queue collection abstracts queues; the Hashtable collection abstracts a lookup table; and so on. Each collection exposes both unique and standard interfaces. The unique interface is specific to the collection type. For example, the Stack type has pop and push methods, whereas the Queue type has Dequeue and Enqueue methods. In addition, collections implement the ICollection, IEnumerable, and ICloneable interfaces. (These interfaces were described earlier in this ...

Get Programming Microsoft® Visual C#® 2008: The Language 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.