C# 密封类
namespace SEALED
{
/*密封类的目的是防止派生的发生*/
sealed class SealedClass
{
public int add(int x, int y)
{
return x + y;
}
}
class Program
{
static void Main(string[] args)
{
SealedClass sealedcls = new SealedClass();
int total = sealedcls.add(4,5);
Console.WriteLine("Total="+total .ToString ());
}
}
}
浙公网安备 33010602011771号