Review Questions

   


1:

What are the similarities and differences between delegates and abstract methods?

2:

Why is delegate a good name for the delegate construct?

3:

Where in a program can a delegate definition be positioned?

4:

Consider the following delegate definition:

 public delegate int Filtering(string str); 

Which of the following methods can instances of this delegate encapsulate?

  1. protected int Filtering(string myString, double x) {...}

  2. internal static int FilteringOp(string myStr) {...}

  3. public double Filtering(string str) {...}

  4. public short Sum(int x, int y) {...}

5:

Why must multicast delegates have the return type void?

6:
  1. Which arithmetic operators can be used with multicast delegates?

  2. Which arithmetic operators can be used with events when called from outside the object where they reside?

7:

What is an event handler?


   


C# Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 286
Authors: Stephen Prata

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net