CSharp – ArrayList

To use ArrayList you need: using System.Collections;


using System;
using System.Collections; // class for ArrayList

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            // <type> <name of the list> = new ArrayList()
            ArrayList list = new ArrayList();
            // add an element
            list.Add("Mario");
            list.Add("Luca");
            list.Add("Giovanni");

            // per ogni elemento nella lista
            foreach (string name in list)
                Console.WriteLine(name);

            Console.ReadLine();
        }
    }
}

The result is:
Mario
Luca
Giovanni

Complete Reference: http://msdn.microsoft.com/it-it/library/system.collections.arraylist(v=vs.110).aspx