Results 1 to 3 of 3
Thread: Array or Vector
- 11-16-2007, 03:16 PM #1
Senior Member
- Join Date
- Nov 2007
- Posts
- 115
- Rep Power
- 0
- 11-16-2007, 04:30 PM #2
If you know how many items you need to store, I think an array is the way to go. The advantage of a vector is its ability to change size. Basically if a vector is full and you add another object, the memory for that object is dynamically allocated. This does not happen in an array. To increase the size of an array, you have to create a new one and copy all of the original values.
So, in my opinion, if there is no chance that you will need more than 10 Strings, go with the array.
- 11-18-2007, 06:19 PM #3
Senior Member
- Join Date
- Nov 2007
- Posts
- 115
- Rep Power
- 0
Similar Threads
-
Convert a vector to a string array
By orchid in forum New To JavaReplies: 4Last Post: 02-24-2010, 02:31 AM -
How i add string array in vector
By susan in forum New To JavaReplies: 7Last Post: 02-12-2009, 01:32 PM -
Converting an Array to a Vector
By Java Tip in forum java.langReplies: 0Last Post: 04-14-2008, 08:44 PM -
Vector help
By king_arthur in forum New To JavaReplies: 3Last Post: 01-22-2008, 07:33 PM -
array vs Vector
By paty in forum New To JavaReplies: 1Last Post: 08-02-2007, 07:07 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks