protected void reallocate(int size){
  Element[] oldStack=stack;
  stack=new Element[size];
  System.arraycopy(oldStack,0,stack,0,oldStack.length);
}

protected void reallocate ( int size ) { Element [ ] oldStack = stack ; stack = new Element [ size ] ; System . arraycopy ( oldStack , 0 , stack , 0 , oldStack . length ) ; }
reallocates the stack to the given size
