C# techniques in connects are declared without needing the
virtual keyword, and overridden within the derived class without needing the
It is possible to reason behind this? I suppose that it's really a language convenience, and clearly the CLR understands how to handle this underneath the covers (techniques aren't virtual automatically), but they are there other technical reasons?
This is actually the IL that the derived class creates:
class Example : IDisposable .method public hidebysig newslot virtual final instance void Dispose() cil handled // finish of method Example::Dispose
Observe that the technique is declared
final within the IL.
Estimating Jeffrey Ritcher from CLR via CSharp 3rd Edition here
The CLR mandates that interface techniques be marked as virtual. Should you don't clearly mark the technique as virtual inside your source code, the compiler marks the technique as virtual and sealed jetski from a derived class from overriding the interface method. Should you clearly mark the method as virtual, the compiler marks the technique as virtual (leaving it unsealed) this enables a derived class to override the interface method. If an interface technique is sealed, a derived class cannot override the method. However, a derived class can re-inherit exactly the same interface and may provide its very own implementation for that interface’s techniques.