what is ienumerable interface?
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 |
Difference between using directive vs using statement?
Hi, I Dont know about Application and Session State management. Can anyone explain me with simple example?
How do cookies work?
How do you trap errors in ASP and how do you invoke a component in ASP ?
What is redirectpermanent in asp.net?
What is the difference between a multi-layer and multi-tier applications?
How do you handle session management in ASP.NET and How do you implement them. How do you handle in case of SQLServer mode?
what is AutoEventWireUp and what is the use of This property explain in details?
What is data control in asp.net?
What is %20 in a url?
what is clr . how we access them?
How many types of validation controls are provided by ASP.NET?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)