Choose The Correct Statements For The Following C Codep Pre #749
Choose the correct statements for the following C# code?</p> <pre><code class="language-csharp" line="1"> public System.Collections.IEnumerator GetEnumerator() { foreach (char ch in chrs) yield return ch; } </code></pre>
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.
Choose the correct statements for the following C# code?
public System.Collections.IEnumerator GetEnumerator() { foreach (char ch in chrs) yield return ch; }
Definition of iterator for MyClass
Implements the GetEnumerator() method defined by IEnumerable
The yield return statement returns the next object in the collection, which in this case is the next character in chrs
All of the mentioned