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 c and c sharp?

1022


What are the different states of a thread?

963


What is garbage collection? How to force garbage collector to run?

962


What is a bool in c#?

918


What are the properties in c#?

991


Explain what a diffgram, and a good use for one Define diffgram? How it be used?

1054


What is parsing?

978


Why do we need abstract class?

957


What is arraylist class in c#?

1148


What is the implicit name of the parameter that gets passed into the class set method?

1048


What is the syntax for calling an overloaded constructor within a constructor (this() and constructorname() does not compile)?

1001


Where do we use serialization in c#?

948


Define c# i/o classes? List the commonly used classes?

1030


What are the types of access modifiers?

957


Does c# have a 'throws' clause?

1096