Interface question

  • Thread starter Thread starter WEB1110
  • Start date Start date
W

WEB1110

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
 
WEB1110 said:
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.

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.

http://code.acadx.com
(Pull the pin to reply)
 
Back
Top