answersLogoWhite

0

A Class may have data members and methods defined, extended, or overridden, while a delegate has no members, no methods.

A delegate is nothing but a method pointer (the method is not invoked immediately, or a defer execution some may call it), or a wrapper around a particular classification of existing methods, regardless those methods are public, internal, private (yes, a private method may be wrapped as a delegate), static or not!!

For examples:

public delegate void NoArgumentProcedure();

public delegate int StringToIntConvertor(string aString);

NoArgumentProcedure clear = Console.Clear; //Clear() is not called yet

StringToIntConvertor converter = int.Parse; // a static method

If you look carefully how the actual method being assigned to a delegate variable, you would notice the syntax may seem to be "property" signatures. Aha, delegate CANNOT point to property! (because the set/get are 2 different classification of methods!!)

User Avatar

Wiki User

14y ago

What else can I help you with?