SHARE
TWEET

Untitled

a guest May 22nd, 2011 97 Never
  1. import javax.script.ScriptEngine;
  2. import javax.script.ScriptEngineManager;
  3. import javax.script.ScriptException;
  4.  
  5. public class hi
  6. {
  7.   public static void main(String[] args)
  8.   {
  9.     ScriptEngineManager factory = new ScriptEngineManager();
  10.  
  11.     ScriptEngine engine = factory.getEngineByName("JavaScript");
  12.     try
  13.     {
  14.       engine.eval("print(\"hello\")");
  15.     }
  16.     catch (ScriptException e) {
  17.       e.printStackTrace();
  18.     }
  19.   }
  20. }
RAW Paste Data
Top