Pass an Interface object as an argument to function

  • Thread starter Thread starter None
  • Start date Start date
N

None

Hi,

Is it possible to pass an Interface object as an argument to some
function. If anybody knows the solution please let me know.

Thanks
Vinoth
 
None said:
Is it possible to pass an Interface object as an argument to some
function. If anybody knows the solution please let me know.

If you mean "Is it possible to write a method which takes an interface
type as the type of one of its parameters?" then - absolutely. It's a
very common part of good design. Look at ArrayList.Sort, for example -
a couple of its overloads take an IComparer to use during the sort.
 
Hi,


is this what you want: void Proc1( IInterface theParameter) ?

if not put an example in pseudo code of that you want.


cheers,
 
Back
Top