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 Possibly misleading Master Exam 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 "Possibly misleading Master Exam question" Watch "Possibly misleading Master Exam question" New topic

Possibly misleading Master Exam question

Hareendra Reddy
Ranch Hand

Joined: Jan 09, 2011
Posts: 173

Hello all,
This is a question from master exam -1.
How we can deduce is in player package or not without looking at
source file,It is also possible to make a class and create the appropriate directory structure ...
and one more mistake using cpjar instead of mp.jar...

Question is as follows:

Given that the MusicPlayer project is on a UNIX system and consists of the following files:
Inside mp.jar file the structure is:
You are currently in the directory
and the CLASSPATH is set to
What command(s) can you use to invoke the class player.MusicPlayer? (Choose all that
Correct Answer
E: java -cp classes player.MusicPlayer
H: java -cp /mp/jars/cp.jar player.MusicPlayer
Ankit Garg

Joined: Aug 03, 2008
Posts: 9466

This question has been asked before, you can try to search it. The answer is that the structure of the jar file is your clue that MusicPlayer is in player package. The directory structure in a jar has to be correct for the jar to work. In some cases on the exam you have to assume that things will work fine. Like in this case you'll have to assume that the jar is valid. Like if you get a question which has a code fragment where line numbers are starting from 5 or 10 (or any number other than 1), then you can assume that there are necessary import statements to make the code work (in case line numbers start from 1 then you know you'll have to check imports too)...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: Possibly misleading Master Exam question
jQuery in Action, 3rd edition