Chapter 8 Flashcards Preview

Visual Programming - CS411 > Chapter 8 > Flashcards

Flashcards in Chapter 8 Deck (9)
Loading flashcards...
1
Q

What is function pointer/delegate

A

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.

2
Q

How we initialize delegate

A

new keyword

3
Q

Does event contains list of delegates

A

Yes

4
Q

What does System.Windows.Form do

A

Give us GUI

5
Q

What is try catch exception handling

A

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.

6
Q

What is finally block in try catch

A

The code inside finally block have to execute in all cases whether exception raises or not.

7
Q

What happened if there is an exception and could not caught in try catch

A

OS will recognize it and program will crash. So there should not be uncaught exception.

8
Q

What is throw

A

Exceptions can be explicitly generated by a program using the throw keyword

9
Q

What is event registration

A

Adding a delegate in event list