In this line what happens if there are no tokens on the stack?
result= numberStack.pop();
Hint: the stack is empty so there is nothing to pop...
It seems as if push
is never called, so please debug the loop before to check why this is the case.