Maha

Maha

  • NA
  • 600
  • 66.6k

what is List?

Nov 24 2014 6:46 AM
In this example List is given a type 'int' so that can we say List does not have type. If so, what is List. Problem is heighlited.

using System;
using System.Collections.Generic;

class Program
{
static void Main()
{
List<int> oyears = new List<int>();
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();
}
}


Answers (2)