首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

,小弟不解!

2012-01-19 
高手请进,小弟不解!!!!!!!!由于类List ProductInfo 实现了IList ProductInfo 接口,那请问下面两种写法

高手请进,小弟不解!!!!!!!!
由于类List <ProductInfo> 实现了IList <ProductInfo> 接口,那请问下面两种写法有何区别?
1、IList <ProductInfo>   productsBySearch   =   new     List <ProductInfo> ();
2、IList <ProductInfo>   productsBySearch   =   IList <ProductInfo> (new   List <ProductInfo> ());


[解决办法]
第一种能使用List <ProductInfo> 的方法和属性,而第二种又转化成了Ilist,只能使用Ilist的了吧。。。。自己想的。

热点排行