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 |
Explain the difference between array and linkedlist?
In ViewState How much lifespan items stored?
What is the difference between managed and unmanaged code? *******
Describe the sequence of action takes place on the server when ASP.NET application starts first time?
Are cookies stored on server or client?
What a diffgram is, and a good use for one?
How asp.net mvc differs from asp.net web forms? : asp.net mvc
What is .Net3.0 and .Net3.5? Describe something about that Features..
What is content place holder?
Explain the life cycle of an ASP .NET page.
For a webapplication if i want to gice access controls like admin,users how can i give security like rolebased?
version information is mentioned in which file