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
Okay, so an int is a value type, and a class is a reference type. How can int be derived from object?
What is the use of protected in c#?
Explain About multi level and multiple inheritance how to achieve in .net
How string definitions will prevent escaping on backslashes in C#?
What are the different ways of method can be overloaded?
How do generics work in c#?
What does question mark mean in c#?
What is stringwriter c#?
What is a linq in c#?
What are the different types of classes in c#?
Which is faster iqueryable or ienumerable?
Define the term immutable ?
What is immutable in C#?
What is dapper in c#?
What is the benefit of interface in c#?