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
Define dll hell?
Describe the master page.
Can we make activex dll also ti execute in some process as that of client ? How can we do?
What are ASP.NET Web Forms? How is this technology different than what is available though ASP?
Which protocol is used to call a web service?
What do you mean by serialize?
What is viewstate? In which event of the page life cycle, is the viewstate available?
What is Cookies Less Session?
How do we sort the data from a dataset?
Explain automatic memory management in .net.
How do you implement sql caching in asp.net?
where can i gather the materials for MCP certification
What is & in a url?
What are the different types of cookies in asp.net?
What is the namespace to create thread in .net?