C#泛型学习笔记

泛型默认值default 如果T是int默认是0  str默认是null 

public class MyTest<T>
{
public T GetValue()
{
T t = default(T);
return t;
}
}

  

posted @ 2017-11-14 14:35  Quintinz  阅读(126)  评论(0编辑  收藏  举报