Sealed Classes

Sealed classes are the reverse of abstract classes. While abstract classes are inherited and refined in the derived type, sealed classes cannot be inherited. A sealed class cannot be refined any further. An abstract class is "abstract" (which perhaps goes without saying), while a sealed class is concrete. You can create instances of a sealed class. Sealed classes are terminating nodes in a class hierarchy, while an abstract class is typically near the top of a class hierarchy. A sealed class is used to prevent further refinement through inheritance. For example, I am a developer of a class library. Some of the classes in the class library are extensible. However, other classes are intended to be used "as is." Those classes are marked ...

Get Programming Microsoft® Visual C#® 2008: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.