Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You know how to use standard parameters that allow you to specify a value at runtime, like the String to be displayed in the MessageBox or the Integer Capacity of a new ArrayList. GENERICS are also a kind of parameter, but instead of specifying a value, they specify a type.
The ArrayList contains instances of System.Object, and it always casts whatever you pass to it to that type. We’ve seen that that’s time-consuming and error-prone because there’s nothing to prevent you from adding objects of different types to the set, and that will come back to bite you. List(of T) is the generic equivalent of the ArrayList. It can do almost everything ArrayList can do, and some more besides, but because you specify the type at runtime, it doesn’t have to cast everything to System.Object.