Chapter 8 Flashcards
What is function pointer/delegate
Such a variable which contains the address of a function. A delegate in C# is similar to a function pointer in C or C++. Using a delegate allows the programmer to encapsulate a reference to a method inside a delegate object. The delegate object can then be passed to code which can call the referenced method, without having to know at compile time which method will be invoked. In fact, delegate is a variable the hold the reference of method.
How we initialize delegate
new keyword
Does event contains list of delegates
Yes
What does System.Windows.Form do
Give us GUI
What is try catch exception handling
Such a code where an exception code occur, we put it inside try block. And if exception occurs then also put it inside catch block.
What is finally block in try catch
The code inside finally block have to execute in all cases whether exception raises or not.
What happened if there is an exception and could not caught in try catch
OS will recognize it and program will crash. So there should not be uncaught exception.
What is throw
Exceptions can be explicitly generated by a program using the throw keyword
What is event registration
Adding a delegate in event list