Interface question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • WEB1110

    #1

    Interface question

    Hi y'all,

    Somewhere, in passing, I saw some code where an interface was used as a
    parameter to a method. I thought it was pretty neat, but now that I had a
    bit of time to get back to trying it out, I cannot get the code to work.

    I'd give more details, but I only recall seeing the technique, sorry.

    Help would be appraciated.

    Thanx,
    Bill


  • Frank Oquendo

    #2
    Re: Interface question

    WEB1110 wrote:
    [color=blue]
    > Somewhere, in passing, I saw some code where an interface was used as
    > a parameter to a method. I thought it was pretty neat, but now that
    > I had a bit of time to get back to trying it out, I cannot get the
    > code to work.[/color]

    Most likely what you saw was something like this:

    void DoSomething (IComparable comparer)

    This allows you to pass any object which implements the specified
    interface.

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.


    (Pull the pin to reply)


    Comment

    Working...