B
Bill Butler
news:[email protected]...
I have read that C# passes objects by reference. This doesn't seem to
be
the case given the program below. I expected it to print "second", but
it
prints "first".
Can anyone explain this behaviour?
This is because C# does not pass by reference as you have just shown.
C# passes object references by value.
You can get Call-by-reference behavior by using the ref keyword, if you want