You are developing a custom-collection class.You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement.<br /> Which criterion should the method meet?()<p> You are developing a custom-collection class.You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement.<br /> Which criterion should the method meet?()</p>
A、A.The method must return a type of either IEnumerator or IEnumerable.
B、B.The method must return a type of IComparable.
C、C.The method must explicitly contain a collection.
D、D.The method must be the only iterator in the class.