Chapter 1

Additional Web Questions

1) The Java Development Kit download from Sun Microsystems contains the Java API Documentation.

a)_____ true

b)_____ false

Answer: B. The JDK available from the Sun Microsystems website does not include the Java API Documentation. The documentation is a separate download, and you should consider it mandatory for learning Java programming.

2) You do not need a Java virtual machine to run Java programs.

a)_____ true

b)_____ false

Answer: B. You do need the Java Virtual Machine to run Java programs. The virtual machine is responsible for converting platform-independent Java bytecodes into an executable format which your particular type of computer can run.

3) The name Java2 is a code name for Java version 1.2.

a)_____ true

b)_____ false

Answer: A. The name Java2 is a code name for Java version 1.2.

4) The filename extension ‘.class’ is used to denote Java source code files.

a)_____ true

b)_____ false

Answer: B. Java source code should be stored within files named with the ‘.java’ extension.

5) The filename extension ‘.java’ is used to denote compiled Java program files.

a)_____ true

b)_____ false

Answer: B. Compiled Java programs are stored within files named with the ‘.class’ extension.

6) The environment variable CLASSPATH is used by your operating system to locate the JVM.

a)_____ true

b)_____ false

Answer: B. No, the environment variable CLASSPATH is used by the JVM to locate Java class files used by a particular Java program.

7) Java sourcecode filenames are case-sensitive, and follow a strict naming convention.

a)_____ true

b)_____ false

Answer: A. Java filenames do follow a strict naming convention; filenames are dependent upon the name of the class definition that they contain, and are case-sensitive as well.

8) All web browsers support Java2, without requiring a plug-in.

a)_____ true

b)_____ false

Answer: B. At the time of publication, no web browser supports the Java2 specification without requiring the use of a plug-in. We expect this will change in the near future, as web browser manufacturers scramble to support Java versions at the break-neck rate with which Sun improves Java technology.

9) Java applets can be run outside of a web browser.

a)_____ true

b)_____ false

Answer: A. Applets can be run via the appletviewer program provided with the Sun JDK, or via appletviewer-like programs written by others.

10) Java applications can be run inside a web browser.

a)_____ true

b)_____ false

Answer: B. Without (often extensive) modification, Java applications cannot be run within a web browser.