This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Mock Exam Question Doubt, 36: 74 from K&B CD 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 "Mock Exam Question Doubt, 36: 74 from K&B CD" Watch "Mock Exam Question Doubt, 36: 74 from K&B CD" New topic
Author

Mock Exam Question Doubt, 36: 74 from K&B CD

Robert Elbourn
Ranch Hand

Joined: Oct 15, 2007
Posts: 69
Its the Music Player project on the Unix system:
consisting of the following files:

/mp/player/MusicPlayer.java
/mp/classes/player/MusicPlayer.class
/mp/jars/mp.jar
inside mp.jar file the structure is:
player/MusicPlayer.java
player/MusicPlayer.class
You are currently in the directory
/mp
and the CLASSPATH is set to /mp/jars

What command(s) can you use to invoke the class player.MusicPlayer?

Correct Answer:

java -cp classes player.MusicPlayer
java - cp /mp/jars/cp.jar player.MusicPlayer


Wait a minute... cp.jar ? I spotted that and left it out, no way will that run!!! and I got the q wrong... can anyone confirm this?
Kelvin Chenhao Lim
Ranch Hand

Joined: Oct 20, 2007
Posts: 513
Hi Robert,
Yes, that's a known error in the Master Exam. So don't worry, Java's not performing some esoteric magic filename translation here.


SCJP 5.0
Robert Elbourn
Ranch Hand

Joined: Oct 15, 2007
Posts: 69
thanks for the response!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Mock Exam Question Doubt, 36: 74 from K&B CD