public class Foo
{
private double field;
public double A
{
get { return field + 10.0; } // 1
set { field = value - 10.0; } // 2
}
public int B { get; private set; } // 3
}
public static class Program
{
public static void Main()
{
Foo f = new Foo();
double a = f.A; // 4
int b = f.B; // 5
f.B = 10; // 6
}
}
Login in to like
Login in to comment