This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt at K&b chapter 10,question 11 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt at K&b chapter 10,question 11" Watch "Doubt at K&b chapter 10,question 11" New topic
Author

Doubt at K&b chapter 10,question 11

Hareendra Reddy
Ranch Hand

Joined: Jan 09, 2011
Posts: 173

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??
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

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...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Hareendra Reddy
Ranch Hand

Joined: Jan 09, 2011
Posts: 173

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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt at K&b chapter 10,question 11
 
Similar Threads
Mistake in GuideBook for SCJP Java 6.0, Chapter 10, Self Test question 11
Confusion over java classpath
K&B doubt regarding question in Development chapter
Question related to self test question in SCJP (Sierra/Bates) Java 6 book
chapter 10 question number 11 k&b book (on jar files)