父類: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 回答
- 0 關注
- 600 瀏覽
添加回答
舉報
0/150
提交
取消