Take out a piece of paper. We’ll be programming on paper.
Write a reallocate method for the DynamicArrayOfStrings class that increases the size of the instance variable holding the Strings.
This method must copy the values from the old array to the new array.
Hint Java has a class Arrays with a method copyOf.
/**
* Copies the specified array, truncating or padding with nulls (if necessary) so the copy has the specified length.
* @param original - the array to be copied.
* @param newLength - the length of the copy.
* @return a copy of the original array, truncated or padded.
*/
Arrays.copyOf(T[] original, int newLength);Write the
boolean add(String s);method.