The below method is meant to work similar to the way an ArrayList would work with the `add` method: The given double is added to the end of the array. Obviously since you can't add to arrays, a new array is returned with the number added to the end. I'm worried about using this in loops due to performance, because if I add something hundreds of times, I'll be creating hundreds of array objects. Is this bad? Will it cause issues? public static double[] add(double[] array, double... toAdd) { double[] newArray = new double[array.length + toAdd.length]; System.arraycopy(array, 0, newArray, 0, array.length); System.arraycopy(toAdd, 0, newArray, array.length, toAdd.length); return newArray; }