sealed methods, why to include the override modifier

  • Thread starter Thread starter muler
  • Start date Start date
M

muler

"If an instance method declaration includes the sealed modifier, it
must also include the override modifier." The C# Programming Language,
§ 10.5.5 Sealed Methods

Why is this?

Thanks,
Mulugeta
 
"If an instance method declaration includes the sealed modifier, it
must also include the override modifier." The C# Programming Language,
§ 10.5.5 Sealed Methods

Why is this?

The "sealed" modifier is only used when overriding a virtual method -
if you're not overriding anything, the method is implicitly sealed
unless you use the "virtual" modifier.

Jon
 
Back
Top