// Use this function
public void increaseSize() {
String[] temp = new String[original.length + 1];
for (int i = 0; i < original.length; i++){
temp[i] = original[i];
}
original = temp;
}
newSizeArray = Arrays.copyOf(oldsizeArray, newSize);
The size of an array cannot be changed after instantiation
If you need to change the size, create a new array and copy the contents
or use an ArrayList which does require a set size
int[] num = new int[5];