2
Answers

what is List?

Maha

Maha

9y
736
1
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)
Next Recommended Forum