locked
need help to solve question. RRS feed

  • 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);


    asim
    Saturday, 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.NET
    • Proposed as answer by Ryukin Saturday, October 10, 2009 9:40 PM
    • Marked as answer by SP Ninja Sunday, October 11, 2009 3:17 AM
    Saturday, 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.com
    Saturday, 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# & .NET
    Saturday, October 10, 2009 8:33 PM
  • I think the answer is D.
    asim
    Saturday, 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.NET
    • Proposed as answer by Ryukin Saturday, October 10, 2009 9:40 PM
    • Marked as answer by SP Ninja Sunday, October 11, 2009 3:17 AM
    Saturday, October 10, 2009 9:39 PM