using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
List
oyears.Add(1990);
oyears.Add(1991);
oyears.Add(1992);
oyears.Add(1993);
oyears.Add(2001);
oyears.Add(2002);
oyears.Add(2003);
foreach (int item in oyears)
{
Console.WriteLine(item);
}
Console.ReadKey();
}
}


VulpesRank #55 · 29.2K reputationPosted Nov 24, 2014, 1:56 AM EST
This means that you can replace the 'type parameter', T, with any actual type and it will then give you a list of that type.
So List
Generic types save code and reduce complication. If we didn't have them and you wanted a llst of bool say, then you'd have to create a separate class for that even though the code would essentially be just the same as for a list of int.
MahaRank #2,573 · 543 reputationPosted Nov 24, 2014, 2:00 AM EST