复制代码 代码如下:
abstract class AbstractClass
{
public abstract void Method( ) ;
}
sealed class SealedClass: AbstractClass
{
public override void Method( )
{ //... }
}
复制代码 代码如下:
using System ;
class A
{
public virtual void F( )
{
Console.WriteLine("A.F") ;
}
public virtual void G( )
{
Console.WriteLine("A.G") ;
}
}
class B: A
{
sealed override public void F( )
{
Console.WriteLine("B.F") ;
}
override public void G( )
{
Console.WriteLine("B.G") ; }
}
class C: B
{
override public void G( )
{
Console.WriteLine("C.G") ;
}
}
新闻热点
疑难解答
图片精选