Examveda

What does the yield return statement specify in the following C# code snippet?
public System.Collections.IEnumerator GetEnumerator()
{
    foreach (char ch in chrs)
    yield return ch;
}

A. returns the output

B. returns the next object in the collection

C. Both returns the output & returns the next object in the collection

D. none of the mentioned

Answer: Option B


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

Join The Discussion

Related Questions on Miscellaneous in C Sharp