using System; <pre> namespace ConsoleApp2 { class Program { class A { int Fa = 1 ; public A() { ++Fa; } public int f { get { return ++Fa; } set { Fa += value; } } } class B : A { static int Fb = 2 ; public B() { Fb++; base.f = 2; } public new int f { get{ return Fb++ ;} set { Fb += value ;} } public override string ToString() { return String.Format("{0}", base.f + f); } } static void Main() { B obj1 = new B(), obj2 = new B(), obj3 = new B(); obj3.f=obj2.f ; Console.Write(obj1); Console.Write(obj1); Console.Write(obj1); } } }
obj1
get
static
Main()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)