final int MAX_SIZE = 50; int capacityIncrement=0, capacity=MAX_SIZE; double[] myArray = new double[MAX_SIZE]; if (capacityIncrement == 0) { capacity *= 2; } else { capacity += capacityIncrement; } // now create a new array using the updated // capacity value double [] newArray = new double[capacity]; // copy the contents of the original array // to the new array for (int i = 0; i < myArray.length; i++) { newArray[i] = myArray[i]; } // end for // now change the reference to the original array // to the new array myArray = newArray;