using System;
using System.Collections;
namespace ConsoleApplication1
{
class Class2
{
public int number;
public Class2(int iN)
{
number = iN;
}
}
class Class1
{
[STAThread]
static void Main(string[] args)
{
ArrayList alAll = new ArrayList();
for (int i = 0; i < 10; i++)
alAll.Add(new Class2(i));
alAll.Insert(1, new Class2(100));
alAll.RemoveAt(2);
alAll.Capacity = 30;
for (int i = 0; i < alAll.Count; i++)
Console.WriteLine(((Class2)alAll[i]).number);
Class2[] allClass2 = new Class2[alAll.Count];
for (int i = 0; i < alAll.Count; i++)
allClass2[i] = (Class2)alAll[i];
Console.WriteLine("------\n");
for (int i = 0; i < alAll.Count; i++)
Console.WriteLine(allClass2[i].number);
}
}
}