using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication1 { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { child c = new child(); Response.Write(c.func1() + "<br>" + c.func2()); } } public class parent { public virtual string func1() { return "parent Class function 1."; } public virtual string func2() { return "parent Class function 2."; } } public class child : parent { public new string func1() { return "child Class function 1."; } public override string func2() { return "child Class function 2."; } } }
override
virtual
new
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)