父类: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”?给出解释,谢谢!
2 回答
- 2 回答
- 0 关注
- 520 浏览
添加回答
举报
0/150
提交
取消