java 计算器算法脚本

 1 import javax.script.ScriptEngine;
 2 import javax.script.ScriptEngineManager;
 3 
 4 public String Count(String s) throws ScriptException{
 5     ScriptEngineManager sem=new ScriptEngineManager();
 6     ScriptEngine se=sem.getEngineByName("JavaScript");        
 7     System.out.println(se.eval(s).toString());
 8     return se.eval(s).toString();
 9         
10     }

 

 

  

posted @ 2018-06-01 10:14  Bronze-y  阅读(247)  评论(0编辑  收藏  举报