Hi Guys
NP98 Remove(x) & RemoveAt(0)
In the following program activation of Remove(x) is producing //1 2 output. Activation of RemoveAt(0) is producing //2 3 output.
Please explain the reason.
Thank you
using System;
using System.Collections;
class MainClass
{
static void Main(string[] args)
ArrayList a = new ArrayList(10);
int x = 0;
a.Add(++x);
a.Remove(x);
//a.RemoveAt(0);
foreach (int i in a)
Console.Write(i + " ");
}
//1 2
//a.Remove(x);
a.RemoveAt(0);
//2 3