A UNIX user named Bob wants to replace his chess program with a
new one, but he is hot 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)
我分析的结果是D,但是结果是C有高手帮忙给分析下吗?谢谢各位!

解决方案 »

  1.   

    不懂unix   但是scjp要考unix的吗   没听过
      

  2.   

    如果在CLASSPATH中 他运行的时候还要 -classpath吗?肯定在/test:/home/bob/downloads/* .jar 这两个里面嘛 .jar不熟 不知道为什么G不对
      

  3.   

    scjp不考UNIX,这里说UNIX只是为了说明他的目录结构是UNIX的,因为WINDOWS是有盘符的。
      

  4.   

    java -classpath /test:/home/bob/downloads/* .jar games.Chess
    这个写法很奇怪,应该跟classpath后的参数写法有关,不过看jdk文档没找到相关说法