型別引數(類)
宣告:
class MyGenericClass<T1, T2, T3, ...>
{
// Do something with the type parameters.
}
初始化:
var x = new MyGenericClass<int, char, bool>();
用法(作為引數的型別):
void AnotherMethod(MyGenericClass<float, byte, char> arg) { ... }
宣告:
class MyGenericClass<T1, T2, T3, ...>
{
// Do something with the type parameters.
}
初始化:
var x = new MyGenericClass<int, char, bool>();
用法(作為引數的型別):
void AnotherMethod(MyGenericClass<float, byte, char> arg) { ... }