ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  C Sharp
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
About delegates and events?
 Question Submitted By :: Kayalvizhy
I also faced this Question!!     Rank Answer Posted By  
 
  Re: About delegates and events?
Answer
# 1
Delegates in C#
If we look at C++ there is a feature called callback 
function. This feature uses Pointers to Functions to pass 
them as parameters to other functions. Delegate is a 
similar feature but it is more type safe, which stands as a 
stark contrast with C++ function pointers. A delegate can 
hold reference/s to one more more functions and invoke them 
as and when needed.
Any delegate is inherited from base delegate class of .NET 
class library when it is declared. This can be from either 
of the two classes from System.Delegate or 
System.MulticastDelegate
If the delegate contains a return type of void, then it is 
automatically aliased to the type of 
System.MulticastDelegate

Events in c#
Delegate usefulness does not just lie in the fact that it 
can hold the references to functions but in the fact that 
it can define and use function names at runtime and not  at 
compile time. A large goal of design delegates is their 
applicability in events model of .Net. Events are the 
actions of the system on user manipulations (e.g. mouse 
clicks, key press, timer etc.) or any event triggered by 
the program

Example can be seen at 
http://www.codersource.net/csharp_delegates_events.html
 
Is This Answer Correct ?    2 Yes 0 No
Kishoreg
 
  Re: About delegates and events?
Answer
# 2
In C# delegate is a class which contain the referance of a 
function. or we can say that it is an function pointer.

and Event are the action performed by the user such as 
mouse click elc.
 
Is This Answer Correct ?    1 Yes 0 No
Anil Chauhan
 
 
 

 
 
 
Other C Sharp Interview Questions
 
  Question Asked @ Answers
 
How?s method overriding different from overloading?  2
int i = 1; int j = 1; System.Console.WriteLine(i == j); System.Console.WriteLine(i.ToString() == j.ToString()); System.Console.WriteLine((object)i == (object)j); Give the sample code above, what is the output to the console?  3
Did it possible to cast a generic type of derived class to generic type of base class? TCS1
how can i return string by vilating duplicates(inpyt like asdfsda but output should be 2a2d2sf and 2a,2d,2s,f) Microsoft2
What are strin concatation methods in c#? Phoenix-Technologies1
If we inherit a class do the private variables also get inherited ? TCS4
What are the valid parameter types we can pass in an Indexer ? CMC3
What?s an interface class? Mind-Tree4
What r collections c sharp?  2
If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor?  1
What?s the top .NET class that everything is derived from?  3
what is read only and constant IBM8
What?s the .NET datatype that allows the retrieval of data by a unique key?  2
Can you prevent your class from being inherited and becoming a base class for some other classes?  4
Explain about Protected and protected internal, ?internal? access-specifier?  6
What is architecture of your poroject? how i c an say? Phoenix-Technologies1
What?s an interface class?  1
What are the two kinds of properties? Wipro10
Explain About the Sattilite Assembly in .Net Technology? TCS2
WHAT IS THE EXACT USE OF INTERFACE(DONT TELL USE FOR MULTIPLE INHERITANCE) eXensys4
 
For more C Sharp Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com