import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
public class TestCondition {
public static void main(String[] bag) throws Exception {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName(“JavaScript”);
String condition = “10==10 && 20==20″;
System.out.println(engine.eval(condition));
}
}
import javax.script.ScriptEngineManager;
public class TestCondition {
public static void main(String[] bag) throws Exception {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName(“JavaScript”);
String condition = “10==10 && 20==20″;
System.out.println(engine.eval(condition));
}
}
No comments:
Post a Comment