title: Java ScriptEngine: using value on Java side?
body: <p>In a Java program I'm invoking a user-defined JavaScript program:</p>
  
  <pre><code>File userJSFile=...;
  javax.script.ScriptEngineManager mgr=new  ScriptEngineManager();
  javax.script.ScriptEngine scripEngine= mgr.getEngineByExtension("js");
  Object result=scripEngine.eval(new java.io.FileReader(userJSFile));
  </code></pre>
  
  <p>Now I would like to use '<strong>result</strong>': how can I have an access to it? Can I identify it as an array (Can I iterate threw its members), a <code>String</code>, an <code>Integer</code>, etc... ?</p>
  
  <p>Thanks</p>
  
  <p><strong>EDITED</strong>:
  I just know that my user gave me a script returning the last value. I don't know anything about this value. Is it a <code>String</code>, an array, etc.. ? I don't known but I want to use it.</p>