Oracle
1Z0-851 · Question #82
A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the…
The correct answer is B. The JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar.. D. The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes G. The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -classpath /foo/myLib.jar. See the full explanation below for the reasoning.
Question
A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Book class? (Choose three.)
Options
- AThe JAR file is located at $JAVA_HOME/jre/classes/myLib.jar.
- BThe JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar..
- CThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes
- DThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes
- EThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -cp /foo/myLib.jar/
- FThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -d /foo/myLib.jar
- GThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -classpath /foo/myLib.jar
How the community answered
(34 responses)- B82% (28)
- C6% (2)
- E3% (1)
- F9% (3)
Community Discussion
No community discussion yet for this question.