...
首页> 外文期刊>.Net Developer's Journal >Harnessing the Power of Predicates in .NET 2.0
【24h】

Harnessing the Power of Predicates in .NET 2.0

机译:利用.NET 2.0中谓词的力量

获取原文
获取原文并翻译 | 示例
           

摘要

Predicate is a new feature introduced in .NET 2.0 in conjunction with Generic collections. Generics are also new in .NET 2.0; Generic collections are by nature strong-typed. What that means is that if we declare a generic list of Address objects, we can only insert an Address type of object. If you try to insert an object that's not an Address type of object or a derived class of it, you'd get a compilation error. So using Generic collections ensures type-safety. In .NET 1.1, we'd have to use an ArrayList (which is a list of "object"-type items).
机译:谓词是.NET 2.0中与通用集合一起引入的一项新功能。泛型也是.NET 2.0中的新增功能。普通收藏品本质上是强类型的。这意味着,如果我们声明一个地址对象的通用列表,则只能插入地址类型的对象。如果尝试插入不是地址类型的对象或其派生类的对象,则会出现编译错误。因此,使用通用集合可确保类型安全。在.NET 1.1中,我们必须使用ArrayList(这是“对象”类型项的列表)。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号