Lecture overview -- Keyboard shortcut: 'u'  Previous page: Abstract Properties -- Keyboard shortcut: 'p'  Next page: Interfaces [Section] -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 9 : 37
Object-oriented Programming in C#
Abstract classes, Interfaces, and Patterns
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