M
Muthu Arumugam
Tried the following c# code
static void Main(string[] args)
{
ArrayList list = new ArrayList();
int i = 10;
string s = "Test";
list.Add(i);
list.Add(s);
// run it without/with commenting the following 2 lines
s = "hello";
i = 90;
Console.WriteLine(string.Format("{0}, {1}\n", i, s));
Console.WriteLine(list.Contains(i));
Console.ReadKey();
}
It has real wierd behavior when you change values in array list with the
object variables and see if you can use Contains or IndexOf(). They give
wrong results even though i look for the objects with their variables....
any thoughts ? is it a bug ?
muthu
http://techblog.muthuka.com/
static void Main(string[] args)
{
ArrayList list = new ArrayList();
int i = 10;
string s = "Test";
list.Add(i);
list.Add(s);
// run it without/with commenting the following 2 lines
s = "hello";
i = 90;
Console.WriteLine(string.Format("{0}, {1}\n", i, s));
Console.WriteLine(list.Contains(i));
Console.ReadKey();
}
It has real wierd behavior when you change values in array list with the
object variables and see if you can use Contains or IndexOf(). They give
wrong results even though i look for the objects with their variables....
any thoughts ? is it a bug ?
muthu
http://techblog.muthuka.com/