泛型。。。。。。。。。。
C#中泛型的用法还是没弄清楚,大家给举些例子看看看 --------------------编程问答-------------------- http://msdn.microsoft.com/zh-cn/library/512aeb7t(VS.80).aspxhttp://hjf1223.cnblogs.com/archive/2005/08/25/222970.aspx --------------------编程问答-------------------- 泛型方法可以推出泛型参数用起来方便
class Tuple<T1, T2>
{
public Tuple(T1 t1, T2 t2)
{
_t1 = t1;
_t2 = t2;
}
T1 _t1;
T2 _t2;
}
class Tuple
{
public static Tuple<T1, T2> New<T1, T2>(T1 t1, T2 t2)
{
return new Tuple<T1,T2>(t1, t2);
}
}
//有了泛型方法New创建Tuple<T1,T2>实例就非常简单了
Tuple.New(1,"2");
补充:.NET技术 , C#