public static int precedence(char operator) {
        int precedence = 0;
        switch (operator) {
            case '+':
                precedence = 1;
                break;
            case '-':
                precedence = 1;
                break;
            case '*':
                precedence = 2;
                break;
            case '/':
                precedence = 2;
                break;
            default:
                break;
        }
        return precedence;
    }