A UNIX user named Bob wants to replace his chess program with a new one, but he
is not sure where the old one is installed. Bob is currently able to run a Java chess
program starting from his home directory /home/bob using the command:
Java -classpath /test:/home/bob/downloads/*.jar games.Chess
Bob's CLASSPATH is set (at login time) to:
/usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/*.jar
What is a possible location for the Chess.class file?
A. /test/Chess.class
B. /home/bob/Chess.class
C. /test/games/Chess.class
D. /usr/lib/games/Chess.class
E. /home/bob/games/Chess.class
F. Inside jarfile /opt/java/lib/Games.jar (with a correct manifest)
G. Inside jarfile /home/bob/downloads/Games.jar (with a correct manifest)答案是C,不知道怎么推出来的- -
我想不通。
is not sure where the old one is installed. Bob is currently able to run a Java chess
program starting from his home directory /home/bob using the command:
Java -classpath /test:/home/bob/downloads/*.jar games.Chess
Bob's CLASSPATH is set (at login time) to:
/usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/*.jar
What is a possible location for the Chess.class file?
A. /test/Chess.class
B. /home/bob/Chess.class
C. /test/games/Chess.class
D. /usr/lib/games/Chess.class
E. /home/bob/games/Chess.class
F. Inside jarfile /opt/java/lib/Games.jar (with a correct manifest)
G. Inside jarfile /home/bob/downloads/Games.jar (with a correct manifest)答案是C,不知道怎么推出来的- -
我想不通。
但没有:
/home/bob/downloads/games/Chess.class 呀
wow, im joking.i just dont know how to work it out. lol
Thank you for caring!let's wait for the "bull man" to conquer it!^_^
Java -classpath /test:/home/bob/downloads/*.jar games.Chess
使用了classpath参数会设置jvm的类加载路径,CLASSPATH中设置的类路径此时
会被覆盖。而games.Chess,显然games是包名,Chess是类名,即Chess.class文件必在
games/ 下;再加上classpath参数路径,那么Chess.class可能在
/test/games/下; 或/home/bob/downloads/XXX.jar中
故正确的答案应该是C、G