日期:2014-05-18 浏览次数:21129 次
//源码如下:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
using System;
public class A
{
public void F()
{
Console.WriteLine("A.F()");
}
}
class B : A
{
private A a;
public B()
{ }
public B(A a)
{
this.a = a;
}
[color=#FF0000]public new void F()
{
a.F(); //这个调用什么?你看清楚
} [/color]
}
class Test
{
public static void Main()
{
B b1 = new B();
B b2 = new B(b1);
b2.F();
Console.Read();
}
}
}