Sunday, August 29, 2010


Courtesy of Sun Web Learning Center

A programmer wants to work from a directory that contains: - A subdirectory named jarDir that contains a JAR file called MyJar.jar. - A file named that uses MyJar.jar. Which two will allow the programmer to compile the program? (Choose two.)

A Invoke javac -classpath jarDir/MyJar.jar
B Invoke javac -CLASSPATH jarDir/MyJar.jar
C Add jarDir to the CLASSPATH and invoke javac
D Add jarDir/MyJar.jar to the CLASSPATH and invoke javac

A and D are correct. These two approaches correctly match the javac command with the classpath information it needs.

No comments:

Post a Comment