PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

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

PrepAway - Latest Free Exam Questions & Answers

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.

One Comment on “Which code segment should you use?


Leave a Reply