Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ScriptEngineManager mgr = new ScriptEngineManager();
- ScriptEngine engine = mgr.getEngineByName("JavaScript");
- String foo = "40+2";
- try {
- System.out.println(engine.eval(foo));
- } catch (ScriptException ex) {
- System.out.println("Dany vyraz je neplatny!");
- }
Advertisement
Add Comment
Please, Sign In to add comment