How to evaluate or execute a script file?
This example demonstrate how to evaluate script that stored on a file. As we know that the
eval() method can also accept a
Reader object we can then read the script file using
FileReader and pass it as the parameter to the
eval() method of the
ScriptEngine for further evaluation.