Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What are iterators?

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


Please Help Members By Posting Answers For Below Questions

What is difference between an reference type and value type in C#?

1100


What is disco?

979


What is variable in c#?

1003


What is difference between method overriding and method overloading?

1106


Are structs value types c#?

940


Differentiate between the public and private ?

1053


How many digits are in an integer?

901


What is routing in c#?

944


What is datareader c#?

967


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?

1128


explain the nature of the assembly work?

2602


What is meant by console programming?

971


What is difference between C# and VB.NET?

1252


Write a sample code to write the contents to text file in c#?

1001


Is c# static or dynamic?

993