namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
ArrayList counting = new ArrayList();
counting.Add("one");
counting.Add("two");
counting.Add("three");
counting.Add("four");
counting.Add("five");
counting.Add("six");
counting.Add("seven");
Stack numbers = new Stack();
numbers.Push(1);
numbers.Push(2);
numbers.Push(3);
numbers.Push(4);
Console.WriteLine("The number of elements in the arraylist are:");
foreach (object i in counting)
{
Console.WriteLine(i);
}
counting.InsertRange(7, numbers);
Console.WriteLine("The elemets after the insertrange operation are:");
foreach (object i in counting)
{
Console.WriteLine(i);
}
counting.RemoveRange(6, 5);
Console.WriteLine("After apply the RemoveAt operation the arraylist is as:");
foreach (object i in counting)
{
Console.WriteLine(i);
}
}
}
}
|