多做题,通过考试没问题!

微软认证考试

睦霖题库>其他计算机考试>微软认证考试

You work as an application developer at Certkiller .com. You have recently created a custom collection class named ShoppingList for a local supermarket. This custom class will include ShoppinItem objects that have the public properties listed below. * Name * AisleNumber * OnDiscount You are required to enable users of your class to iterate through the ShoppingList collection, and to list each product name and aisle number using the foreach statement.You need to achieve this by declaring the appropriate code.What code should you use?()

  • A、 public class ShoppingList : ICollection {// Class implementation }
  • B、 public class ShoppingList : IEnumerator, IEnumerable {// Class implementation }
  • C、 public class ShoppingList : Ilist {// Class implementation }
  • D、 public class ShoppingList : Enum {// Class implementation }
正确答案:B
答案解析:
进入题库查看解析

微信扫一扫手机做题