Forums Register Login

Doubt at K&b chapter 10,question 11

+Pie Number of slices to send: Send
11. Given the following directory structure:



If the current directory is "test", and myApp/Foo.class is placed in a JAR file called MyJar.jar
located in test, which set(s) of commands will compile GetJar.java and produce the output 8?
(Choose all that apply.)

A. javac -classpath MyJar.jar GetJar.java
java GetJar
B. javac MyJar.jar GetJar.java
java GetJar
C. javac -classpath MyJar.jar GetJar.java
java -classpath MyJar.jar GetJar
D. javac MyJar.jar GetJar.java
java -classpath MyJar.jar GetJar

The answer is given as A, here classpath for java command do not contain MyJar.jar then how it is going to run??
+Pie Number of slices to send: Send
There is an error in this question and it has been pointed out many times like here. Bert is compiling an errata for the book, you can see all the possible errors in this thread...
+Pie Number of slices to send: Send
Thank you Ankit,
Is there any document available which contain these type of errors??
It is difficult to check all the messages done in that topic....
I checked K&B book's home page at McGrawHill's site , but i could not find any errata available for download...
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1209 times.
Similar Threads
Question related to self test question in SCJP (Sierra/Bates) Java 6 book
Confusion over java classpath
javac command (SCJP study guide book)
K&B doubt regarding question in Development chapter
Mistake in GuideBook for SCJP Java 6.0, Chapter 10, Self Test question 11
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:28:39.