This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Classpath question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Classpath question" Watch "Classpath question" New topic

Classpath question

Felix Tang

Joined: Aug 15, 2006
Posts: 7
Q37 of the diagnostic test:

You want to execute a class named My.class in the package whiz.utilities.myapp. The path to that directory is


Which command would you use to run the class?

A. java -classpath . /java/MyPackages/whiz/utilities/myapp My
B. java -classpath /java/MyPackages whiz.utilities.myapp.My
C. java -classpath . java.MyPackages.whiz.utilities.myapp.My
D. java -classpath ./java/MyPackages/whiz/utilities/myapp/My

Am I right to say the answer is B? You can't have a dot without the separator colon( right after it.
Milind Patil

Joined: Oct 19, 2003
Posts: 26
Yes, Answer B is correct.

Milind B. Patil - SCJP-1.4, SCWCD-5.0, SCBCD-5.0
I agree. Here's the link:
subject: Classpath question
It's not a secret anymore!