SCJP 1.6版考題 091

出自 陳富國維基館
前往: 導覽搜尋
A class games.cards.Poker is correctly defined in the jar file Poker.jar.
A user wants to execute the main method of Poker on a UNIX system using the command: java games.cards.Poker

What allows the user to do this?
 A. put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java
 B. put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java/*.jar
 C. Put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java/Poker.jar
 D. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/java
 E. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/java/*.jar
 F. put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/java/Poker.jar

解答


Ans: C

解說:

一個類別games.cards.Poker被正確地定義在 Poker.jar中,一個使用者要去執行類別Poker中的main,
使用如下指令
  java games.cards.Poker
把Poker.jar放在/stuff/java裏,並且設定CLASSPATH 含入stuff/java/Poker.jar