От: | Аноним | ||
Дата: | 27.08.10 07:47 | ||
Оценка: |
class A
{
protected int _p;
public int P
{
get
{
return 1;
}
}
}
class B : A
{
public int P
{
set
{
_p = value;
}
}
}
class Program
{
static void Main(string[] cmd)
{
B b = new B();
int i = b.P; // A.P (get)
b.P = 3; // B.P (set)
}
}