Pham Quỳnh
New member
Choose the correct statements for the following C# code?
A. Definition of iterator for MyClass
B. Implements the GetEnumerator() method defined by IEnumerable
C. The yield return statement returns the next object in the collection, which in this case is the next character in chrs
D. All of the mentioned
Code:
public System.Collections.IEnumerator GetEnumerator()
{
foreach (char ch in chrs)
yield return ch;
}
B. Implements the GetEnumerator() method defined by IEnumerable
C. The yield return statement returns the next object in the collection, which in this case is the next character in chrs
D. All of the mentioned