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

Okay, so an int is a value type, and a class is a reference type. How can int be derived from object?

894


What is the use of protected in c#?

882


Explain About multi level and multiple inheritance how to achieve in .net

979


How string definitions will prevent escaping on backslashes in C#?

933


What are the different ways of method can be overloaded?

820


How do generics work in c#?

862


What does question mark mean in c#?

934


What is stringwriter c#?

768


What is a linq in c#?

824


What are the different types of classes in c#?

899


Which is faster iqueryable or ienumerable?

938


Define the term immutable ?

1007


What is immutable in C#?

959


What is dapper in c#?

880


What is the benefit of interface in c#?

890