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;
}
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

Join The Discussion