> Hi
>
> I have a static function which I want to be supplied
> with a another class. Now the passed class needs to
> be an implementation of that class. How can I make
> sure?
>
> Thanks
>
> Saaransh
Huh?
Could you give an example?
an example:
Lets say I have an interface :
public interface foo
{
//some methods
}
Now thers a static function. Which I want should take in a parameter (an object) which has implemented the above interface.
How do i do this?
NOTE: I am making a framework API and thus the class making the object will not be known to me. It will be created by someone else and not me.
Thanks
public interface Foo { // <- should start with a capital!
//some methods
}
class YourClass {
public static void yourStaticMethod(Foo foo) {
// ...
}
}