根据上面这句话,我们可以设计抽象类继承与接口,子类再继承与抽象类实现接口中的方法.使抽象类与接口完美结合.
接口:
public
interface
IInterface
{
void Fly();
}
{
void Fly();
}
抽象类:
abstract
class
Plane : IInterface
{
IInterface Member#region IInterface Member
public abstract void Fly();
#endregion
}
{
IInterface Member#region IInterface Member
public abstract void Fly();
#endregion
}
子类:
public
class
F22Plane : Plane
{
public override void Fly()
{
//Do something
}
}
{
public override void Fly()
{
//Do something
}
}