Which code segment should you use?

You need to write a multicast delegate that accepts a DateTime argument.
Which code segment should you use?

You need to write a multicast delegate that accepts a DateTime argument.
Which code segment should you use?

A.
public delegate int PowerDeviceOn(bool result, DateTime autoPowerOff);

B.
public delegate bool PowerDeviceOn(object sender, EventArgs autoPowerOff);

C.
public delegate void powerDeviceOn(DateTime autoPowerOff);

D.
public delegate bool powerDeviceOn(DateTime autoPowerOff);

Explanation:
A & B the delegates do not accept an argument of type DateTime D The question does not explicitly mention a return type. Also with multicasting only the return value of the last method called as part of a multicast chain is returned. Hence return values do not tend to be very useful as far as multicasting is concerned.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


seenagape

seenagape

Correct answer is C