I am not 100% sure about java, but most of this goes for C.
When using dynamic memory allocation, a finite size is allocated on the heap. If you need more size than was allocated, there is a realloc command, that in essence sees if there is space left to simply resize, or if there isn’t enough space, finds the next available block with enough space for the array, plus the size needed to resize, and copies all the data. This makes it a very slow procedure.
In Java, being a slightly more abstracted language, I am given to understand you can do this (almost) by using the Vector object (deprecated) or Set, List, which support generics and will give you better control over Strings added to them.
EDIT: It’s late, and the above might not be coherent. While I am too bored to correct it, the gist of what I am saying is that: “Simple array re-sizing isn’t possible at all.” so you either create a new array with a new size, and copy the old data and destroy the old array, OR use available java classes like the deprecated Vector, Set, List etc that will do this for you transparently. In general, realize that this is very bad if it has to happen, and it is best to use some kind of smart resizing. (For example doubling the size of the array each time it needs to be re-sized so as to limit (after a while) the amount of copying that needs to be done.