Apr 15

Java introduced scripting support with Java 6.

Heres a simple example showing how to use the JavaScript scripting engine to evaluate an expression.

ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("JavaScript");
Object result = engine.eval("6 * (3 + 5)");

written by objects \\ tags: , , , ,