Given an array of n Objects, let\'s say it is an array of strings, and it has the following values:
foo[0] = \"a\"; foo[1]
You can always do:
int i, j; for (i = j = 0; j < foo.length; ++j) if (!"a".equals(foo[j])) foo[i++] = foo[j]; foo = Arrays.copyOf(foo, i);