Sunday, December 11, 2011

Designing a class 5: Restricting the instantiation

An object can be restricted from instantiation to mention that it is not complete.

This can be accomplished by declaring the class as abstract.

Keyword:

[VB] MustInherit

[CS] abstract

 

Code Sample:

[VB] Public MustInherit class EmployeeBase

[CS] public abstract class EmployeeBase

No comments:

Post a Comment