File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the response!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic