0_0_39741756_28193\Main.java:18: 错误: 需要<标识符>
scanner.close();
^
0_0_39741756_28193\Main.java:21: 错误: 需要class, interface或enum
private static double evaluateExpression(String expression) {
^
0_0_39741756_28193\Main.java:23: 错误: 需要class, interface或enum
List<Double> numbers = new ArrayList<>();
^
0_0_39741756_28193\Main.java:24: 错误: 需要class, interface或enum
List<Character> operators = new ArrayList<>();
^
0_0_39741756_28193\Main.java:25: 错误: 需要class, interface或enum
for (String token : tokens) {
^
0_0_39741756_28193\Main.java:31: 错误: 需要class, interface或enum
double a = numbers.remove(numbers.size() -1);
^
0_0_39741756_28193\Main.java:32: 错误: 需要class, interface或enum
char operator = operators.remove(operators.size() -1);
^
0_0_39741756_28193\Main.java:33: 错误: 需要class, interface或enum
double result = applyOperator(a, b, operator);
^
0_0_39741756_28193\Main.java:34: 错误: 需要class, interface或enum
numbers.add(result);
^
0_0_39741756_28193\Main.java:35: 错误: 需要class, interface或enum
}
^
0_0_39741756_28193\Main.java:41: 错误: 需要class, interface或enum
double a = numbers.remove(numbers.size() -1);
^
0_0_39741756_28193\Main.java:42: 错误: 需要class, interface或enum
char operator = operators.remove(operators.size() -1);
^
0_0_39741756_28193\Main.java:43: 错误: 需要class, interface或enum
double result = applyOperator(a, b, operator);
^
0_0_39741756_28193\Main.java:44: 错误: 需要class, interface或enum
numbers.add(result);
^
0_0_39741756_28193\Main.java:45: 错误: 需要class, interface或enum
}
^
0_0_39741756_28193\Main.java:47: 错误: 需要class, interface或enum
}
^
0_0_39741756_28193\Main.java:52: 错误: 需要class, interface或enum
return true;
^
0_0_39741756_28193\Main.java:53: 错误: 需要class, interface或enum
} catch (NumberFormatException e) {
^
0_0_39741756_28193\Main.java:55: 错误: 需要class, interface或enum
}
^
0_0_39741756_28193\Main.java:63: 错误: 需要class, interface或enum
case '*':
^
0_0_39741756_28193\Main.java:66: 错误: 需要class, interface或enum
default:
^
0_0_39741756_28193\Main.java:68: 错误: 需要class, interface或enum
}
^
0_0_39741756_28193\Main.java:75: 错误: 需要class, interface或enum
case '-':
^
0_0_39741756_28193\Main.java:77: 错误: 需要class, interface或enum
case '*':
^
0_0_39741756_28193\Main.java:79: 错误: 需要class, interface或enum
case '/':
^
0_0_39741756_28193\Main.java:81: 错误: 需要class, interface或enum
return0;
^
0_0_39741756_28193\Main.java:82: 错误: 需要class, interface或enum
}
^
27 个错误
|