Generic List
Learn about the generic counterpart of the ArrayList class.
We'll cover the following...
Introduction
The ArrayList
class solved the issues we had with arrays, but it also introduced new issues. .NET developers addressed the concerns with a set of generic collection classes. This lesson focuses on the List<T>
class. Instead of using an object[]
type array, like ArrayList
does, generic collections use parameter types. In the case of List<T>
, the internal array is of type T[]
. Generic collections introduce strong typing. The List<int>
class can only store int
items, and List<string>
can only store ...