I am trying to learn IEnumerator and collections(Arr ayList, Hashtable)
in .NET.
Can anyone tell me what is IEnumerator used for and any online
resources would
be helpful.
Blog about software development, algorithms, network protocols, .NET, programming languages, tips & tricks, coding techniques and more.
"starter" <enlight.v@gmai l.com> wrote in message
news:1138525286 .222903.199470@ o13g2000cwo.goo glegroups.com.. .[color=blue]
>
> I am trying to learn IEnumerator and collections(Arr ayList, Hashtable)
> in .NET.
> Can anyone tell me what is IEnumerator used for and any online
> resources would
> be helpful.
>
> Thanks
>[/color]
Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
"starter" <enlight.v@gmai l.com> wrote in message
news:1138525286 .222903.199470@ o13g2000cwo.goo glegroups.com.. .[color=blue]
>
> I am trying to learn IEnumerator and collections(Arr ayList, Hashtable)
> in .NET.
> Can anyone tell me what is IEnumerator used for and any online
> resources would
> be helpful.
>
> Thanks
>[/color]
Think of interface to mean 'feature list' or 'list of capabilities'.
When a class implements an interface, it actually means that class
will have those 'features' or 'capabilities' listed in that interface.
But this time, those features are not just listed but instead are
actually coded ( implemented in code).
If you get to understand this. You will see that
IEnumerator is an inteface that gives the ability to work with a
collection of objects. It has the 'list of features' so that you can
go through each object in the collection. The IEnumerator simply
specifies what are the things you need to do this. If you look at
the documentation is has these members
1. Current - pick current object
2. MoveNext - go to the next object
3. Reset - go back start all over again
Hey, think of it. Those simple three are just ENOUGH to get things
done. There is nothing more you need!!!!! That's serves exactly the
purpose of the interface.
Ok so much for the blah blah. Actual code now!
This article discusses and compares both versions in NET 1.X and .NET
2.0
Comment