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 is the difference between session and viewstate in asp.net?

1097


List the major built-in objects in asp.net?

987


What is server transfer?

882


How u refer webservices?

1933


Differentiate between client-side and server-side validations in web pages.

1004


What is the use of dispose method?

1015


What is application variable?

919


How can we provide the WebParts control functionality to a server control?

986


Which class is used to send an email message from an ASP.NET Web page?

997


What is sdlc process?

981


Explain the use of errorprovider control in .net?

947


Explain Authentication mechanism in dotnet

1019


What is rending process in ASP.NET?

1053


How is the asp.net mvc architecture different from others? : asp.net mvc

1001


Explain why it is useful to use mvc instead of webforms? : asp.net mvc

1029