Brief description  about Online courses   join in Online courses
View naveen reddy  s 's Profile


what is delegate..??
Asked by naveen reddy s | Apr 27, 2011 |  Reply now
Replies (1)
View  's Profile
delegate is like function's pointer in C++, it reference to address to method.

It is defined by using keyword delegate and normal method header, But when we need to handle multiple events, we can use delegate, to perform an method call based on events happened.

Because events occurs at run time. So it can be helpful to decide which method to call based on event happend.

Java don't have such functionality because it will cause security risk. In C++, they are but if method address change and it calls some other method, security will break.

C# have , intermediate level of security because we cannot change method address. :)

Hope this helped you!!

Kanhiya Deswal
Jun 15, 2012