T is the name of the type parameter in the general class. It means Type, but you can also call it Alice.
You use generalizations to enhance reuse in a safe type without unnecessary code duplication. Thus, you do not need to write classes for ListOfIntegers , ListOfStrings , ListOfChars , ListOfPersons , etc., but instead you can write a generic class List<T> , and then create objects of types List<Int32> , List<string> , List<char> and List<Person> . The compiler does the job for you.
jason Dec 30 '09 at 14:09 2008-12-30 14:09
source share