ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript"); try { System.out.println(jse.eval("12+1+2*4/8-1")); } catch (Exception t) { }
09-18
3140
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
ScriptEngine jse = new ScriptEngineManager().getEngineByName("JavaScript"); try { System.out.println(jse.eval("12+1+2*4/8-1")); } catch (Exception t) { }