给定这个界面
public interface IMyInterface
{
string Method1();
}
为什么这是有效的
public sealed class InheretedFromInterfaceSealed: IMyInterface
{
public string Method1()
{
return null;
}
}
但这不是
public class InheretedFromInterfaceWithSomeSealed: IMyInterface
{
public sealed string Method1()
{
return null;
}
}
然而,对于抽象类来说,这是一个有效的场景
public abstract class AbstractClass
{
public abstract string Method1();
}
public class InheretedFromAbstractWithSomeSealed: AbstractClass
{
public sealed override string Method1()
{
return null;
}
}