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

Posted on    March-29-2011 9:11 AM

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

Varun Agrawal
Varun Agrawal

Total Post:159

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