I've observed that Whenever the compiler encountered a delegate declaration like the following:
public delegate string StringOperation(string myString);
Then the compiler is generating the following code:
public sealed class StringOperation: System.MulticastDelegate
{
public StringOperation (object target, int method);
public virtual void Invoke(string myString);
public virtual IAsyncResult BeginInvoke(string myString,
AsyncCallback callback, object obj);
public virtual void EndInvoke(IAsyncResult result);
}
My question is, why would it generate virtual
methods when the class itself is a sealed
class?
There is no point of creating virtual
methods as we cannot override
them right?