public void push(final int a){
  if (pointer >= stack.length) {
    final int[] newStack=new int[(int)(stack.length * 1.5)];
    System.arraycopy(stack,0,newStack,0,stack.length);
    stack=newStack;
  }
  stack[pointer]=a;
  pointer++;
}

public void push ( final int a ) { if ( pointer >= stack . length ) { final int [ ] newStack = new int [ ( int ) ( stack . length * 1.5 ) ] ; System . arraycopy ( stack , 0 , newStack , 0 , stack . length ) ; stack = newStack ; } stack [ pointer ] = a ; pointer ++ ; }
adds an item to the top of the stack , expanding the stack if needed
