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
What is difference between an reference type and value type in C#?
What is disco?
What is variable in c#?
What is difference between method overriding and method overloading?
Are structs value types c#?
Differentiate between the public and private ?
How many digits are in an integer?
What is routing in c#?
What is datareader c#?
if a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?
explain the nature of the assembly work?
What is meant by console programming?
What is difference between C# and VB.NET?
Write a sample code to write the contents to text file in c#?
Is c# static or dynamic?