Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C# Programming
»
Delegates
Which of the following are the correct ways to declare a delegate for calling the function func() defined in the sample class given below? class Sample { public int func(int i, Single j) { /* Add code here. */ } }
delegate d(int i, Single j);
delegate void d(int, Single);
delegate int d(int i, Single j);
delegate void (int i, Single j);
delegate int sample.func(int i, Single j);
Correct Answer:
delegate int d(int i, Single j);
← Previous Question
Next Question→
More Questions from
Delegates
Which of the following is the correct way to call the function MyFun() of the Sample class given below? class Sample { public int MyFun(int i) { Console.WriteLine("Welcome to CuriousTab.com !" ); return 0; } }
Which of the following statements are correct about delegates? Delegates are not type-safe. Delegate is a user-defined type. Only one method can be bound with one delegate object. Delegates can be used to implement callback notification. Delegates permit execution of a method on a secondary thread in an asynchronous manner.
Suppose on pushing a button an object is to be notified, but it is not known until runtime which object should be notified. Which of the following programming constructs should be used to implement this idea?
Which of the following statements are correct about delegates?
Suppose a Generic class called SortObjects is to be made capable of sorting objects of any type (Integer, Single, Byte etc.). Which of the following programming constructs should be used to implement the comparision function?
Which of the following statements is incorrect about a delegate?
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments