SCJP 1.6版考題 060
出自 陳富國維基館
1. package com.company.application; 2. 3. public class MainClass{ 4. public static void main(String[] args){} 5. } And MainClass exists in the /apps/com/company/application directory. Assume the CLASSPATH environment variable is set to "." (current directory). Which two java commands entered at the command line will run MainClass? (Choose two.) A. java MainClass if run from the /apps directory B. java com.company.application.MainClass if run from the /apps directory C. java -classpath /apps com.company.application.MainClass if run from any directory D. java-classpath . MainClass if run from the /apps/com/company/application directory E. java -classpath /apps/com/company/application:. MainClass if run from the /apps directory F. java com.company.application.MainClass if run from the /apps/com/company/application directory
解答
Ans: B C
解說:
MainClass 位於 in the /apps/com/company/application,CLASSPATH設為”.”(即目前的目錄),要能執行MainClass要如何下指令?
|