Home > DeveloperSection > Interviews > How do you prevent a class from being inherited?

Posted on    March-29-2011 9:11 AM

 VB.Net VB.Net 
Ratings:
 1 Answer(s)
  1109  View(s)
Rate this:

Varun Agrawal
Varun Agrawal

Total Post:159

Points:795
Posted on    March-29-2011 12:00 AM

In VB.NET you use the NotInheritable modifier to prevent programmers from using the class as a base class.

In C#, use the sealed keyword.

Don't want to miss updates? Please click the below button!

Follow MindStick