W
WRH
Hello
The following code snippet works fine...
....
string str = "";
ArrayList ac = new ArrayList();
char c = 'C';
ac.Add(c);
str += ac[0];
.....
However, if instead of str += ac[0] I use
str = ac[0];
the compiler complains...
"cannot implicitly convert type 'object' to 'string'
and I have to cast it to string, eg
str = (string)ac[0]
Its not a problem..just trying to understand...
The following code snippet works fine...
....
string str = "";
ArrayList ac = new ArrayList();
char c = 'C';
ac.Add(c);
str += ac[0];
.....
However, if instead of str += ac[0] I use
str = ac[0];
the compiler complains...
"cannot implicitly convert type 'object' to 'string'
and I have to cast it to string, eg
str = (string)ac[0]
Its not a problem..just trying to understand...