Sunday, December 18, 2011

Designing a class 6: Restricting a class from inheriting

A class can be marked as complete so that it can not be inherited further. You can use the following keyword to achieve this.

[VB] NotInheritable

[CS] sealed

Code Sample

[VB] Public NotInheritable Class Manager

[CS] public sealed class Manager

No comments:

Post a Comment