CSharp examples for Language Basics:ref
Ref Local Field
using System;// www . j a v a 2s.com using System.ComponentModel; class RefLocalField { private int value; static void Main() { var obj = new RefLocalField(); ref int tmp = ref obj.value; tmp = 10; Console.WriteLine(obj.value); obj = new RefLocalField(); Console.WriteLine(tmp); Console.WriteLine(obj.value); } }