public class MyClass
{
public MyClass()
{
this.y = 4;
this.y = 6;
SetField( ref this.y );
}
private void SetField( ref int val )
{
val = 8;
}
public readonly int x = 123;
public readonly int y;
public const int z = 555;
}
public class MainClass{
static void Main()
{
MyClass obj = new MyClass();
System.Console.WriteLine( "x = {0}, y = {1}, z = {2}",
obj.x, obj.y, MyClass.z );
}
}
x = 123, y = 8, z = 555