Maheal <ma********@yahoo.com> wrote:
Take the following code:
string s = "Hello";
object a = s;
object b = s;
would (a == b) return a true value? Basically, I want to know if
boxing the same value references only one object, or if each object
creates a new reference, but with the same value. Thanks!
There's no boxing going on there - string is a reference type.
However, if you do:
int i = 10;
object a = i;
object b = i;
then the objects will indeed be different, and (a==b) is false.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too