修饰符
class A {
public void F()
{ Console.WriteLine("A.F");
}
public virtual void G() { Console.WriteLine("A.G");}
}
class B: A
{
new public void F(){Console.WriteLine("B.F");}
public override void G() {Console.WriteLine("B.G"); }
}
class Test
{
static void Main()
{
B b = new B();
A a = b;
a.F();
b.F();
a.G();
b.G();
}
}
此例中的new 与virual修饰服是什么意思呢???