Professional Documents
Culture Documents
Parameter Passing in C#: 1. Value Types
Parameter Passing in C#: 1. Value Types
Parameter Passing in C#: 1. Value Types
So there I was, merrily browsing the Internet when I came across this fantastic site on
topics such as:
Type initializers,
Static constructors,
By the way, when you get to the section in Jon's article called:
"Sidenote: what is the difference between passing a value object by reference and a
reference object by value?"
Please read it carefully, it's an extremely good point. It can be sumed up by comparing
the final assignment statement above (Reference Types Passed by Reference) to the
final assignment statement in in diagram #5 (Reference Types Passed by Value). It's a
subtle, but important difference.
Oh and the quiz, what is the value of the Console.WriteLine in #7?
Answer: NullReferenceExceptinon Object reference not set to an instance of an object
Still confused? Then I didn't do my job right, since this is the point in the article when I
thought pictures would help. So please post your thoughts whether it makes sense or
not.
- Lee