C# Collections Introduction


Arrays in C# are implemented as instances of the System.Array class and are just one type of collection classes, which maintain lists of objects. Several interfaces in the System.Collections namespace provide basic collection functionality: IEnumerable, ICollection, IList, and IDictionary. The System.Array implements IEnumerable, ICollection and IList but it doesn’t support some of the more advanced features of IList and it represents a list of items using a fixed size.

One of the classes in the System.Collections namespace, System.Collections.ArrayList also implements IList, ICollection and IEnumerable but it does so in a more sophisticated way than System.Array. Here you can use variable-length lists of items.

Leave a comment

Your email address will not be published. Required fields are marked *