car.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace work098
{
public class Car
{
public string GetCar()
{
return "CAR";
}
}
public class CarA : Car
{
public new string GetCar()
{
return "CAR A";
}
}
}
webform1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace work098
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
work098.Car c1 = new Car();
c1.GetCar();
work098.CarA c2 = new CarA();
c2.GetCar();
}
}
}