public void pop() {
    // no need to clear previously used members in the stack.
    // the stack is short-lived, and does not create new instances for
    // the depth levels, in other words, it does not affect GC and does
    // not save memory to clear the stack.
    depth--;
  }
public void pop()