试题详情
单项选择题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
  • 关注下方微信公众号,在线模考后查看

热门试题