What is difference Between Function Overloading and delegates in C#
-
hi every on plz i am confuge between function overloading and delegates in C# plz tell me what is difference Between Function Overloading and delegates in C#. Rahul!
A delegate is basically a pointer to a method. Function overloading is when you implement several methods with the same name but with different sets of parameters.
Ut Rahul wrote:
i am confuge
I am sorry to hear that. That sounds quite painful. ;) --- b { font-weight: normal; }
-
hi every on plz i am confuge between function overloading and delegates in C# plz tell me what is difference Between Function Overloading and delegates in C#. Rahul!
Delegate/Events are more or less like an array of references to methods in objects. Overloading seeks to slightly alter, in a way customize, behavior for implemented objects. They are really different methods exhibiting different behavior. Although you can similate overriding with events but one should really avoid it. Likewise, you can similate events using virtual behavior as well but again you should avoid it.
-
Delegate/Events are more or less like an array of references to methods in objects. Overloading seeks to slightly alter, in a way customize, behavior for implemented objects. They are really different methods exhibiting different behavior. Although you can similate overriding with events but one should really avoid it. Likewise, you can similate events using virtual behavior as well but again you should avoid it.
Tom Larsen wrote:
Overloading seeks to slightly alter, in a way customize, behavior for implemented objects.
I reckon that you are thinking of overriding, not overloading. (Then again, that could also been what Ut Rahul was thinking of...) --- b { font-weight: normal; }