File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!