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 is ienumerable interface?

Answer Posted / bipin

The IEnumerator interface provides iterative capability for
a collection that is internal to a class.
IEnumerator requires that you implement three methods:

The MoveNext method, which increments the collection
index by 1 and returns a bool that indicates whether the
end of the collection has been reached.

The Reset method, which resets the collection index to
its initial value of -1. This invalidates the enumerator.

The Current method, which returns the current object at
[position].

public bool MoveNext()
{
position++;
return (position < carlist.Length);
}

public void Reset()
{position = 0;}

public object Current
{
get { return carlist[position];}
}

IEnumerable interface
The IEnumerable interface provides support for the foreach
iteration. IEnumerable requires that you implement the
GetEnumerator method.

public IEnumerator GetEnumerator()
{
return (IEnumerator)this;
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What would be salary for 8+ years of experience in ASP.NET in different metro city in india?

2456


How to implement role based security in asp.net mvc? : Asp.Net MVC

1083


What is difference between web config and global asax?

869


Explain how do you validate the controls in an asp .net page?

932


Difference between response.redirect and server.transfer?

1028


What is the difference between an htmlinputcheckbox control and an htmlinputradiobutton control?

1130


How can we call webservices in Banking Applications? and where we are using it?

2089


How can we implement a identity (sql server) call in an asp.net page?

1022


What I need to create and run an asp.net application?

974


What is directive in asp net?

1021


Which methods validate all the controls on a page?

977


How to add DateTime Control in normal DataGrid Server Control?

1096


About CLR, reflection and assemblies?

1970


What are the features of asp.net mvc?

1004


What is asp.net localization?

988