I've just gone through the test questions for chapter 10 (Development) and don't understand the answer given.
It says that A is correct and C is not and I don't understand the difference. Why you can use the -classpath MyJar.jar in the javac invocation yet it's not allowed in the java invocation (Answer C)? Also, how does the java GetJar call in answer A find MyApp.Foo with a classpath specified?
I think you should post the question here. OR should have mentioned the question number. I had to go through all the question to find the actual question.
May be thats the reason , this post was unanswered for such a long time.
Why option A is correct,
When the classpath is not set in the command line or if the CLASSPATH environment variable is not set, then the classpath point to current directory.
For more calrification , check these links.
The reason why option C is wrong is because GetJar.class is not reachable.
The command should be java -classpath MyJar.jar;. GetJar
Note the classpath is only pointing to test/*.jar but not to test/.....
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
Kedar Nath you must not use illegal copies of books. It is unethical in addition to being illegal. And anyone who has a legal copy of the book knows that this is probably an error in the book which Bert is looking after and soon an errata will be published in this regard...