publicoverridevoidShowNumber() { Console.WriteLine("Base number is {0}", Number.i.ToString()); Console.WriteLine("New number is {0}", i.ToString()); } }
classTest_Number { publicstaticvoidMain()//Main_6_1_1 { Number num = newNumber(); num.ShowNumber(); IntNumber intNum = newIntNumber(); intNum.ShowNumber(); intNum.ShowInfo(); Number number = newIntNumber(); //究竟调用了谁? number.ShowInfo(); //究竟调用了谁? number.ShowNumber(); Console.Read(); } }