This is a mirror of official site: http://jasper-net.blogspot.com/

Ref Keyword for Reference Types

| Monday, June 14, 2010
The Ref keyword is well known. It indicates that you are passing a reference, not a value, to a method. That means that if the method modifies the value, the changes will be apparent to the calling method as well.

Where I see a lot of confusion, however, is what happens when dealing with reference types. It is common to say that methods pass objects by reference, but that's not entirely true.

First, a pop quiz. Without actually running the code, what do you think this code snippet will produce?

Read more: Codeproject

Posted via email from .NET Info

0 comments: