I am trying to use a vector to get the ability to add elements dynamically. But, in certain parts of my code, I need to have it become an array.
I have found the Vector.toArray() API from searching on this forum so far.
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html#toArray()
How do I make sure I initilize the array to the correct size?
Vector dataVector2 = new Vector();
String[][] data2 = new String[4][8]; //4 = rows, 8 = columns. But if I add a
//fifth row, how can I code it to look for
//that while the program is running?
//To convert it, is it just
data2 = dataVector2.toArray();
Thanks