[java] equivalent to push() or pop() for arrays?