请教下这个错误是怎么回事?谢谢……
abstract class Square : TemplateClass //爸爸级{
public Square(string shape, double length)
: base(shape, length)
{
//显式调用基类的构造方法
}
protected override void Length(double length)
{
double squareLength;
squareLength = 4 * length;
Console.WriteLine
("边长为{0}的正方形周长 = {1}", length, squareLength);
}
protected override void Area(double length)
{
double area;
area = Math.Pow(length, 2);
Console.WriteLine
("边长为{0}的正方形面积 = {1}", length, area);
}
public void GetResult()
{
Length(length);
Area(length);
Volume(length);
}
abstract protected void Volume(double length) //定义一个抽象方法
{
//定义方法
}
}
//错误提示:“抽象类2.Square.Volume(double)”无法声明主体,因为它标记为 abstract