sealed classes,sealed methods in C#

Sealed class is like the normal class but the sealed class can't inherited but can be instantiated like normal class.To declare sealed class we should use the sealed keyword with the class declaration.The sealed classes are useful inorder to protect our classes not to be used by any other classes.

Syntax :

    sealed class Employee
    {
        protected string ename;
    }

No comments:

Post a Comment