When I try to use the function to iterate the user input expression, I get the java.lang.NumberFormatException, I try fixing the loop much time, but I still cannot understand where did it when wrong. The IDE suggest it went wrong in the parstInt while loop
Here is the code:
import java.util.Scanner;
import java.util.Stack;
static Stack<Integer> stackForOperand = new Stack<Integer>();
static Stack<Character> stackForOperator = new Stack<Character>();
public static int processOneOperator(char stackForOperator, int num1, int num2) {
    int result = 0;
    switch (stackForOperator) {
    case '+':
        result = num1 + num2;
    case '-':
        result = num1 - num2;
    case '*':
        result = num1 * num2;
    case '/':
        if (num2 != 0) {
            result = num1 / num2;
        } else {
            throw new UnsupportedOperationException("divide by zero error");
        }
    }
    return result;
}
public static boolean num_order(char first, char second) {
    if (first == '(' || second == ')') {
        return false;
    } else if ((first == '*' || first == '/') && (second == '+' || second == '-')) {
        return false;
    } else {
        return true;
    }
}
public static int calculation_loop(String expression) {
    for (int i = 0; i < expression.length(); i++) {
        if (expression.charAt(i) >= '0' && expression.charAt(i) <= '9') {
            String more_num = "";
            while (i < expression.length() && expression.charAt(i) >= '0' && expression.charAt(i) <= '9') {
                more_num += expression.charAt(i++);
                int more_num2 = Integer.parseInt(more_num);
                stackForOperand.push(more_num2);
                i--;
            }
        } else if (expression.charAt(i) == '(') {
            stackForOperator.push(expression.charAt(i));
        } else if (expression.charAt(i) == ')') {
            while (stackForOperator.peek() != '(') {
                stackForOperand.push(
                        processOneOperator(stackForOperator.pop(), stackForOperand.pop(), stackForOperand.pop()));
                stackForOperator.pop();
            }
        } else if (expression.charAt(i) == '+' || expression.charAt(i) == '-' || expression.charAt(i) == '*'
                || expression.charAt(i) == '/') {
            while (!stackForOperator.empty() && num_order(expression.charAt(i), stackForOperator.peek())) {
                stackForOperand.push(
                        processOneOperator(stackForOperator.pop(), stackForOperand.pop(), stackForOperand.pop()));
                stackForOperator.push(expression.charAt(i));
            }
        }
    }
    while (!stackForOperator.empty()) {
        stackForOperand
                .push(processOneOperator(stackForOperator.pop(), stackForOperand.pop(), stackForOperand.pop()));
    }
    return stackForOperand.pop();
}
public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    System.out.println("/");
    String input = scanner.nextLine();
    input = input.replaceAll("\\s+", "");
    System.out.println(input);
    Integer output = calculation_loop(input);
    System.out.println(output);
}
}
 
     
    