Is any difference between :
public void Method1(class1 c, T obj) where T:Imyinterface
And
public void Method2(clas
There is no big difference for void
methods.
public void Method1(class1 c, T obj) where T : Imyinterface
equals to
public void Method2(class1 c, Imyinterface obj, Type t)
where t
must be Imyinterface
.
So if you need to pass some Type
to your method, and you need to apply some constraints to that Type
at compile-time, use the generic method.