john said:
How can you create a collection of objects in C# like you can in VB?
In VB you say
Dim myCol as new Collection
and then add the item and index
There's one other view of Collections in .Net and VB and that is the support
of the 'for each' syntax.
In the case of .Net, a class that wants to support for_each must implement
the IEnumerable interface and, thus, support the GetEnumerator method.
Otherwise, as far as adding items and indexing items, you can do it pretty
much however you like (and there were several suggestions already which I
won't repeat).
--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]