Not quite.
You construct two objects, and assign them to different variables - one gets an
x
property of 22 so we will call this "x22" the other gets 33, so we will call this x33
obj1 refers to x22
obj2 refers to x33
You then assign the content of
obj2
to
obj1
obj1 refers to x33
obj2 refers to x33
x22 is no longer referenced, so the garbage collector can Dispose of it.
obj1
and
obj2
both can be used, but they refer to the same object in memory - and change made via
obj1
will be seen via
obj2
as well.