Friday, February 20, 2015

Sealed Classes in c#

If a class is defined as Sealed it cannot be inherited in derived class.

public sealed class Car
{

public Car()
{
Console.WriteLine("Base Class Car");
}

public void DriveType()
{
Console.WriteLine("Right Hand ");
}
} 

No comments:

Post a Comment