March 2004
Intermediate to advanced
560 pages
26h 47m
English
using System;
using System.Collections;
namespace Samples
{
public class ICollectionSample
{
public static void Main()
{
ArrayList al = new ArrayList();
al.Add("damien");
al.Add("mark");
al.Add("brad");
Array a = Array.CreateInstance(typeof(string), al.Count);
al.CopyTo(a, 0);
Console.WriteLine("The contents of the array are:");
for(int i = 0; i < a.Length; i++)
Console.WriteLine("{0} ",a.GetValue(i));
}
}
}
The contents of the array are: damien mark brad
Read now
Unlock full access