This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Chapter 10 Question  11 of SCJP K and B Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Chapter 10 Question  11 of SCJP K and B" Watch "Chapter 10 Question  11 of SCJP K and B" New topic

Chapter 10 Question 11 of SCJP K and B

jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266
package myApp;
public class Foo{public static int d =8;}
public class GetJar{
public static void main(String[] args){


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 comments will compile and produce the output 8?

a. javac -classpath MyJar.jar
java GetJar
b. javac MyJar.jar
java GetJar
c. javac -classpath MyJar.jar
java -classpath MyJar.jar GetJar
d. javac MyJar.jar
java -classpath MyJar.jar GetJar

Whats the correct answer to the above question ? The book says A. I tried searching and it appears that the correct answere is : java -classpath MyJar.jar:. GetJar Please comment
Ankit Garg

Joined: Aug 03, 2008
Posts: 9327

Yes you are right jose, this problem has been reported to the authors and hopefully soon you'll see an errata of the SCJP 6 book...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Bharathula Venkata

Joined: Jun 28, 2010
Posts: 6
Yes True, I was also confused because the answer to the next question contradicts this....:-(
subject: Chapter 10 Question 11 of SCJP K and B