Geeks With Blogs
Nitin Reddy
DisguiseA search comparing the StringCollection to the ArrayList may give you articles that say "the ArrayList works better than the StringCollection" but what you need to know is that a StringCollection is simply extra methods over an ArrayList - there is an actual ArrayList included as a private member within the StringCollection class and it caters to storage needs of StringCollection. In other words, the StringCollection is just a disguised ArrayList!

You don't really have to decide between using an ArrayList or the StringCollection wrapper - both are essentially the same! You use a StringCollection wrapper when you are dealing with strings... the cast to a string is performed by a method in the wrapper so you don't have to do it each time you access it. If you aren't dealing with strings, the StringCollection isn't an option anyway. Posted on Tuesday, July 8, 2008 6:43 PM | Back to top


Comments on this post: StringCollection Internals

# re: StringCollection Internals
Requesting Gravatar...
Just use a List of String. Array lists are pretty much obsolete.
Left by Josh on Jul 08, 2008 8:59 PM

Your comment:
 (will show your gravatar)


Copyright © Nitin Reddy Katkam | Powered by: GeeksWithBlogs.net