What is the difference between this:
void MyMethod(IMyInterface value)
{
//...
}
and this:
void MyMethod(T val
Yet another difference for generic methods in general (though not for your example) is that if one has a method like T MungeThing<T>(T it) where T:IMungeable<T>
and class Fnord
implements IMungeable<Fnord>
, then code will be able to say: Fnord thing1, thing2; ... thing1 = MungeThing(thing2);
and the compiler will know that MungeThing
will return a Fnord
rather than some arbitrary implementation of IMungable
.