import java.io.*; import java.util.*; import javax.script.*; public class Jtest3{ public static void main(String[] args){ ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine js = factory.getEngineByName("JavaScript"); Object obj = js.get("toString"); System.out.printf("%s\n",obj); } /* output rhino: null output nashorn: function toString() { [native code] } */ }