consider following:
1st APPROACH:
public void f3()
{
f2();
f1();
}
and this ...
2nd APPROACH:
class Sample
{
public delegate void MyDelegate(string s);
MyDelegate obj;
public Sample()
{
obj += new MyDelegate(input);
obj+=new MyDelegate(something);
obj += new MyDelegate(someStaticMethod);
}
}
When i call f3() it will call the functions listed inside it ... same would happen when i will invoke a delegate ... so whats the use of delegate to handle some event when i can use 1st approach ... the 1st approach too encapsulates the method call..