如何隐含对泛型的约束 [英] how to implemnet Constraints on generics

查看:77
本文介绍了如何隐含对泛型的约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们如何实现对泛型的约束,
我当时在Google那里有很多东西,但我听不懂.

因此请提供一种最简单的方法例如:

Hi ,

how can we implement constraints on generics,
i was google lot of stuff was there but i was unable to understand.

so kindly provide one easiest method Ex:

class Emp
{
p int Id{get,set;}

}


以上面的例子并向我们解释

问候
James


take the above example and explain us

Regards
James

推荐答案

在MSDN上阅读以下内容:
Read the following on MSDN : http://msdn.microsoft.com/en-us/library/d5x73970%28v=vs.80%29.aspx[^]


我知道链接了

我正在寻找简单的解释.
i knew about the link

im looking for the simple explanation.


这篇关于如何隐含对泛型的约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆