Sealed classes are those classes which cannot be inherited. It means we cannot inherit the sealed class the only way to create object of that class and then use it.
Below is a sample of sealed class
// Sealed class
sealed class SampleSealedClass
{
public int Add(int x, int y)
{
return x + y;
}
}
Below is a sample of sealed class
// Sealed class
sealed class SampleSealedClass
{
public int Add(int x, int y)
{
return x + y;
}
}
Comments
Post a Comment