Answered by:
need help to solve question.

Question
-
I am prepairing .net exam and trying to solve this question. any help appreciated
you need to write a multicast deledate that accepts DateTime argument and returns a Boolean value. Which code segment should you use?A. public delegate int PowerDeviceOn(bool, DateTime);
B. public delegate bool PowerDeviceOn(Object, EventArgs);
C. public delegate void PowerDeviceOn(DateTime);
D. public delegate bool PowerDeviceOn(DateTime);
asimSaturday, October 10, 2009 8:15 PM
Answers
-
The answer is C.
You are right in case of Singlecast delegate, but the question clearly says that you need to write a MulticastDelegate.
System.MulticastDelegate inherits from System.Delegate.
Check this article for more reference.
http://msdn.microsoft.com/en-us/library/system.multicastdelegate%28VS.71%29.aspx
Learning C# & ASP.NETSaturday, October 10, 2009 9:39 PM
All replies
-
Sorry dude, this is an easy exam question ... we really don't want to do your school work for you. Look carefully at the signatures of the 4 statements ... take into account the parameters passed and the value returned. No more clues from me.
~~Bonnie Berent [C# MVP]
(new blog --- not many posts yet --- be patient)
geek-goddess-bonnie.blogspot.comSaturday, October 10, 2009 8:29 PM -
I agree with bonnie. Check for information about delegate, write an example & you would know what params & signatures should be followed while writing a delegate.
http://msdn.microsoft.com/en-us/library/aa288459%28VS.71%29.aspx
FYI. I passed 70-536 a week ago & I still remember the answer for this question given in the test prep CD.. lol. There is plethora of information & examples all over the MSDN site for reference.
Good Luck.
Learning C# & .NETSaturday, October 10, 2009 8:33 PM -
I think the answer is D.
asimSaturday, October 10, 2009 8:52 PM -
The answer is C.
You are right in case of Singlecast delegate, but the question clearly says that you need to write a MulticastDelegate.
System.MulticastDelegate inherits from System.Delegate.
Check this article for more reference.
http://msdn.microsoft.com/en-us/library/system.multicastdelegate%28VS.71%29.aspx
Learning C# & ASP.NETSaturday, October 10, 2009 9:39 PM