Paul Stat wrote:
But what happens to the original String[] array, is it just subject to the garbage collector?
If you are talking about this
String[] sa =
new String[3]; // intialise sa to accept 3 String objects
Then yes that string array will be eligible for GC. This is the related statement from the documentation
If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list.