HOW DO YOU PREVENT A CLASS FROM BEING INHERITED?

Varun Agrawal

Total Post:159

Points:795
Posted by  Varun Agrawal
VB.Net 
 1317  View(s)
Ratings:
Rate this:
  1. Varun Agrawal

    Post:159

    Points:795
    How do you prevent a class from being inherited?

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!