aspose file tools*
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
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: 9313
    
  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