Interfaces multiple choice question

Posted on 2006-06-05
Last Modified: 2006-11-18
Given an interface named IWriteable, what type of object can be passed to the method with the following declaration? public bool Save(Iwriteable obj)

      a.       any object  
      b.       any object that implements the IWriteable interface  
      c.       any object that implements the Save method  
      d.       only objects created from the IWriteable class  
Question by:igor92128
    LVL 6

    Expert Comment

    This is obviously a homework question man... We can't just answer questions like this!

    Oh, btw, it's E

    Author Comment

    Its 500 points, dude.
    LVL 1

    Accepted Solution

     b.      any object that implements the IWriteable interface  
    LVL 9

    Assisted Solution

    When you create an interface and pass it as a parameter you are basically setting up a contract saying that you will guarantee that the object being passed it will have methods with known signatures and properties that have to be there, whether fully implemented or not.

    What would it be any object? the compiler will stop you with that one. C is just plain retarded.

    So any object that implements the interface would work, which also means any object created from the object.  Interfaces don't create objects, objects only implement them.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Live - One-on-One C# Help from Top Experts

    Solve your toughest problems, fast.
    C# experts are online now and ready to help you.

    Article by: Ivo
    Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now