Collection or array?

Invisionsoft

Well-known member
Joined
Apr 20, 2007
Messages
64
Location
United Kingdom
Programming Experience
1-3
Arrays and collections are two ways to store lists of strings, such as:

John
Bob
James
Bill Gates

My collection or array will have to store hundreds of names, which is more efficient or better for the job?


- James
 
You havent said what you plan on doing with your data, so it's not possible to answer your question.

Do you know the number of items and will never modify the order or the number of items? Use an array. Otherwise, use a collection.

I seldom use arrays now, except byte arrays for TCP/IP
 
Whoops, sorry for not telling you what I'm using it for. I'll be doing all sorts to that array or collection such as removing blank items, adding items at various places, looping through the list and rebuilding the list in order to make changes to the item values.


Regards
James
 
Back
Top