Type Parameters Methods
suggest changeDeclaration:
void MyGenericMethod<T1, T2, T3>(T1 a, T2 b, T3 c)
{
// Do something with the type parameters.
}
Invocation:
There is no need to supply type arguments to a generic method when the compiler can infer them.
int x =10;
int y =20;
string z = "test";
MyGenericMethod(x,y,z);
Type arguments can still be supplied explicitly:
MyGenericMethod<int, int, string>(x,y,z);
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents