Generics

Introduction to .NET Framework 3.0 · Wikibooks

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From Wikibooks, under CC BY-SA 4.0, as the source states it. This page at Wikibooks.

    Generics

    Microsoft has introduced new generical features in its .NET 3.0. Until now, it was mandatory that the whole list should be declared as a single data type. However, in .NET 3.0, it is possible to have multiple declarations of the same list with multiple data type and the datatype of the data contained in it changes.

    Example

    List<string> customerList = new List<string>(); 
    customerList.Add('Ravi');
    customerList.Add('Bala');
    List<int> customerList = new List<int>();
    customerList.Add(1);