This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Robert Elbourn
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 513
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Robert Elbourn
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the response!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic