Assume you declare three delegates named delegate1, delegate2, and delegate3. You then assign a reference to method M1() to delegate1, and a reference to method M2() to delegate2. How do you make delegate3 into a composed delegate that executes both M1() and M2()? What are the rules concerning return type and parameter list for composed delegates?
What will be an ideal response?
When the statement delegate3 = delegate1 + delegate2 executes, delegate3 becomes a delegate that executes both M1() and M2(), in that order. Only delegates with the same parameter list can be composed, and the delegates used must have a void return type.
You might also like to view...
The "^" and "$" characters represent:
a. back references b. the beginning and end of a string c. the beginning and end of a regular expression d. none of the above
A spin lock (see Bacon [2002]) is a boolean variable accessed via an atomic test-and-set instruction, which is used to obtain mutual exclusion. Would you use a spin lock to obtain mutual exclusion between threads on a single-processor computer?
What will be an ideal response?
The ________ function is used to calculate the average of a range of cells that meet one criterion
A) AVERAGEIFS B) AVERAGE C) AVG D) AVERAGEIF
An applet uses a method named ____ to build the GUI and register listeners for the components that generate events.
A. super() B. init() C. applet() D. set()