父类:
class TestBase
{
public string name="Aa";
public string GetName()
{
return this.name;
}
}
子类:
class Test : TestBase
{
public new string name = "Bb";
}
在页面中调用子类:
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Test t = new Test();
Response.Write(t.GetName());
}
}
请问是输出结果是 “Aa” 还是 “Bb”?给出解释,谢谢!