Abstract classes, Interfaces, and Patterns
- slide 9 : 37
Sealed Classes and Sealed Methods
A sealed class C prevents the use of C as base class of other classes
Sealed class
Cannot be inherited by other classes
Seals all virtual methods in the class
Sealed method
Cannot be redefined and overridden in a subclass
The modifier
sealed
must be used together with
override
A sealed, overridden method prevents additional overriding