非常容易复制,但输出却很奇怪;
期望的输出是“bbb bbb” 实际输出是“aaa bbb”
有没有人有任何关于这种行为的MSDN解释?我找不到。
((a)new b()).test();
new b().test();
public class a
{
public virtual void test(string bob = "aaa ")
{
throw new NotImplementedException();
}
}
public class b : a
{
public override void test(string bob = "bbb ")
{
HttpContext.Current.Response.Write(bob);
}
}