Tuesday, July 8, 2014

Daily Interview Question #12 : What is the purpose of “sealed” keyword in C#?.

Sealed
1. When you want to prevent an class from being inherited by another class, you should use “sealed” keyword in front of the class.


2. You can use the sealed keyword with properties and methods also. In this case, you should use sealed keyword with “override”.
3. You cannot use “abstract” keyword with sealed modifier.

No comments:

Post a Comment

Please give your valuable comments to improve the contents