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
There are few things Which I am putting as points below. Hope you will get help from this.
String store[] = new String[words.length] instantiates an array of
Strings but It does not instantiate any of the elements with any non
null value. Default value is null so this is an array of null
Strings.(words[i] != target) should be replaced with
(!words[i].equals(target))