How can prevent a class to be inherited?

 Posted by Rajni.Shekhar on 4/9/2012 | Category: C# Interview questions | Views: 1426 | Points: 40

Using sealed keyword with class. you can use sealed class using object but can not inherit any class from a sealed class.


sealed class exampleSealed{

//code of a class.

class derived : exampleSealed{ //error can not inherit from exampleSealed

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response