Type Parameters Methods

suggest change

Declaration:

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 arguements to a genric method, because the compiler can implicitly infer the type.

int x =10;
int y =20;
string z = "test";
MyGenericMethod(x,y,z);

However, if there is an ambiguity, generic methods need to be called with type arguemnts as

MyGenericMethod<int, int, string>(x,y,z);

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Generics:
* Type Parameters Methods

Table Of Contents
17 Regex
19 Arrays
21 Enum
22 Tuples
24 GUID
27 Looping
36 Casting
46 Methods
57 Generics
88 Events
92 Structs
104 Indexer
106 Stream
107 Timers
109 Threading
127 Caching
135 Pointers
147 C# Script