1. Rhino is originated by _______
Explanation: The spawn(f) runs f() or loads and executes file f in a new thread.
3. Which of the following reads the textual contents of a URL and returns as a string?
4. Which Rhino command quits Rhino environment?
Explanation: quit() is a predefined command in rhino. The quit() command makes Rhino exit.
5. Which is a useful way to try out small and simple Rhino programs and one-liners?
a) Starting an interactive shell
b) Starting a one to one shell
c) Creating a thread to do simple programs
d) Starting a multiple shell
Explanation: Rhino is distributed as a JAR archive. Start it with a command line like this :
java -jar rhino1_7R2/js.jar program.js
If you omit program.js, Rhino starts an interactive shell, which is useful for trying out simple programs and one-liners.
importClass(java.util.HashMap); // Same as : var HashMap = java.util.HashMap
7. Consider the following code snippet
var f = new java.io.File("/tmp/test"); var out = new java.io.FileWriter(f); out instanceof java.io.Reader
What will be the output for the above code snippet?
Explanation: The output for the above code snippet is false as it is a writer and not a Reader.
8. What does Rhino do when the getter and setter methods exist?
b) Java classes are used to avoid them