What Does The Yield Return Statement Specify In The Following C #750
What does the yield return statement specify in the following C# code snippet?</p> <pre lang="csharp" line="1"> public System.Collections.IEnumerator GetEnumerator() { foreach (char ch in chrs) yield return ch; }
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Reflections, Multithreaded Programming, Collection Classes and Mathematical Functions - Iterators - Quiz No.1.
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 B C D E F G H I J K L M N O P Q R S T U V
Run time error
U T S R Q P O N M L K J I H G F E D C B A
Compile successfully prints nothing