An array has a fixed size. A List<T> can grow. Most of the time you want the list.
Program.cs
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
string[] fixedSize = { "red", "green" };
List<string> cities = new List<string> { "Vienna", "Oslo" };
cities.Add("Lisbon");
Console.WriteLine(fixedSize.Length);
Console.WriteLine(cities.Count);
Console.WriteLine(cities[0]);
}
}
Output
2 3 Vienna
Counting starts at zero
The first item is cities[0]. With three items the valid indexes are 0, 1 and 2 — asking for cities[3] throws.
Note the two names for size: arrays have Length, lists have Count.