C#中继承抽象类 override是写在子类前还是写在要重写的方法前?比如:
publicabstractclassArea{publicabstractvoidarea();}publicoverrideclassCircle:Area{priv...
public abstract class Area
{
public abstract void area();
}
public override class Circle : Area
{
private double r;
public double R
{
get { return r; }
set { r = value; }
}
public Circle(double x)
{
this.r = x;
}
public void area()
{
Console.WriteLine("圆的面积为:" + 3.14 * r * r);
}
} 展开
{
public abstract void area();
}
public override class Circle : Area
{
private double r;
public double R
{
get { return r; }
set { r = value; }
}
public Circle(double x)
{
this.r = x;
}
public void area()
{
Console.WriteLine("圆的面积为:" + 3.14 * r * r);
}
} 展开
2个回答
2015-05-18
展开全部
override是重写的意思
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询