Examveda

Choose the correct statements for the following C# code?
public System.Collections.IEnumerator GetEnumerator()
{
    foreach (char ch in chrs)
    yield return ch;
}

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

Answer: Option D


This Question Belongs to C Sharp Programming >> Miscellaneous In C Sharp

Join The Discussion

Related Questions on Miscellaneous in C Sharp