so this would be my class:
public class ListArray {
private String[] array;
private int numElements;
public void reSize{
}
What's the best way to reSize "array"?
I was thinking doing something like this
String newArray = new String[array.size]
for (int i = 0; i < array.length; i++){
newArray[i] = array[i];
}
array = new String[array.size *10]; //resize to 10x original size
then copying everything over from newArray to the "new" array.
But that seems very inefficient. Are there better ways?