C# where语法问题
题目
C# where语法问题
public static T AsActual(this T persistable)
where T :IPersistable
public interface IRepositoryFactory
{
T GetRepository()
where T :class;
}
上面两种函数后带where的写法是什么意思?与LinQ有关?
答案
对T的一种约束,比如where T:IDispose
就是说T必须实现IDispose接口
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
最新试题
热门考点