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.

Computer Science & Information Technology

You might also like to view...

________ can be created so that XML data can be viewed in a web browser

Fill in the blank(s) with correct word

Computer Science & Information Technology

Which of the following is NOT true about databases?

A) A database eliminates the need for a paper-based system. B) Information is data that has been manipulated. C) In business, data is collected and used for decision making. D) Databases are used for operational processing and for analytical purposes.

Computer Science & Information Technology