Answer Posted / gp_bellamkonda
What Sumit suggested was correct.Adding few more points to
it.
--The iterator code uses the yield return statement to
return each element in turn. yield break ends the
iteration. For more information, see yield.
--Multiple iterators can be implemented on a class. Each
iterator must have a unique name just like any class
member, and can be invoked by client code in a foreach
statement as follows: foreach(int x in
SampleClass.Iterator2){}
--The return type of an iterator must be IEnumerable,
IEnumerator, IEnumerable<T>, or IEnumerator<T>.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is c# easier than javascript?
Explain the difference between abstract class and interface in .net?
What is delimiter in c#?
The int maps to which C# keyword in .NET type?
What is the difference between selection and projection?
Define delegate in c#?
To create a localized application which namespaces are necessary?
What is the difference between constant and readonly in c#?
Explain the difference between class and interface in .net?
What are c# types?
How to create multi-dimensional array?
What is generic in c#?
Is inheritance possible in c sharp?
What is parameters in c#?
Define xslt.