About delegates ?

Answers were Sorted based on User's Feedback



About delegates ?..

Answer / naren

1. Delegates holds reference to a method
2. Delegates are objects which points towards a function
which matches its signature
3. Delegates are reference type used to encapsulate method
with specific signature
4. Delegates are typesafe and secure

//declaring a delegate

delegate void SampleDelegate(string message)

//declaring delegate with same signature

static void SampleDelegateMethod(string message)
{
console.writeline(message);
}

//creating delegate method

SampleDelegate d1 = new SampleDelegateMethod();

//invoking method

d1(message);

Is This Answer Correct ?    10 Yes 1 No

About delegates ?..

Answer / sridevi

Delegates are like function pointer in c++ with type-safe.
They can be used in 2 situations
1. callback methods
2. eventHandler

Is This Answer Correct ?    4 Yes 0 No

About delegates ?..

Answer / ravindra

delegate is a reference type which is used to encapsulate a
method with specific signature.
delegates are 2 types
1.single cast delegate
2.multi caste delegate.
Adv:
1.it will improve the performance of the application.

Is This Answer Correct ?    5 Yes 1 No

About delegates ?..

Answer / payal

Delegate hold reference to another function or method

Is This Answer Correct ?    3 Yes 1 No

About delegates ?..

Answer / amit kumar

delegates holds the reference of the function
then you can call that function through the delegate object

main benifit of delegate is that you can make difference
between class objects
you can assign the different -2 methods to different-2
object of same class

Is This Answer Correct ?    2 Yes 0 No

About delegates ?..

Answer / guest

these are just reference to the methods and delegates are
used at the bottom of events.

Is This Answer Correct ?    1 Yes 0 No

About delegates ?..

Answer / prithviraj p

Delegate is a strongly typed function pointer. A delegate
object encapsulates a reference to a method

Is This Answer Correct ?    0 Yes 1 No

Post New Answer



More ASP.NET Interview Questions

how can i insert array values and retreive in asp.net

3 Answers   Value Labs, TCS,


1.how to encrpt query string in asp.net? 2.there are 10000 records then i wnat display 5000 records one gridview and 5000 records another grid view what is the process?

0 Answers   Marlabs,


What is .NetFramework?

1 Answers   Syntel,


Can we use http handlers to upload a file in asp.net?

2 Answers  


Given an ASP.NET Web Form called WebFrom1, what class does the WebForm1 class inherit from by default? a) System.Web.Form b) System.Web.GUI.Page c) System.Web.UI.Page d) System.Web.UI.Form

3 Answers   Syntax Softtech,






What is a session government?

0 Answers  


What are tuples?

0 Answers  


what is meant by sitemapnode ?

0 Answers   Netsweeper,


Webconfig file is cofiguration of server or browser?

10 Answers   Wipro,


What is scope of an application variable in asp.net?

0 Answers  


What is the file through which you can customize your asp.net application?

0 Answers  


if we establish the cinnection with connection string tag in web.config file,can i go for encrypt and decrypt with that?

1 Answers  






Categories