I\'m trying to remove the empty element from the array by copying the existing element to a new array. However, initialization of the new array is causing my return value to
I'm actually not sure what you want to achieve but if you want to remove an empty String out of your array you can do it with streams and filters in java 8 like this: