Sun Java Solaris Communities My SDN Account Join SDN
 
Quizzes

Essentials of the Java Programming Language Quiz

 

Quizzes Index

Programming Language Quiz


January 2000

Duke Essentials of the Java Programming Language is a great resource to launch a comprehensive study of the Java programming language, or to explore other features on the Java platform. Take this short quiz to test your knowledge of Lessons 1 through 5.

1. A program written in the Java programming language can run on any platform because...


 A. Java programming is derived from C++.
 B. The Java Virtual Machine1(JVM) interprets the program for the native operating system.
 C. The compiler is identical to a C++ compiler.
 D. The APIs do all the work.


2. An applet will run in almost any browser because...

 A. The server has a built-in JVM.
 B. The browser has a built-in JVM.
 C. The source code is interpreted by the browser.
 D. Applets don't need a JVM.


3. What is the purpose of the main method?

 A. To build a user interface.
 B. To hold the APIs of the application.
 C. To create buttons and scrollbars.
 D. To act as the entry point for the program.


4. The Applet class provides...

 A. A browser to run the applet.
 B. Methods to define the applet's behavior and appearance.
 C. A special HTML page.
 D. Permission to communicate with the server.


5. Which method will a web browser call first on a new applet?

 A. main method
 B. start method.
 C. init method.
 D. paint method.


6. What is the advantage of using import statements?

 A. To avoid having to declare variables.
 B. To refer to a class without using prefixes.
 C. To avoid calling methods.
 D. To import the images you want to use.


7. When a program class implements an interface, it must provide behavior for...

 A. Two methods defined in that interface.
 B. Only certain methods in an interface.
 C. Any methods in a class.
 D. All methods defined in that interface.


8. A constructor is used to...

 A. Free memory.
 B. Initialize a newly created object.
 C. Import packages.
 D. Create a JVM for applets.


9. The BorderLayout class provides static fields for...

 A. Introducing new methods.
 B. Adding components to specific areas of a container.
 C. Starting an applet.
 D. Specifying font size and color.


10. Servlets are typically used for...

 A. Creating graphics.
 B. Extending a web server by providing dynamic web content.
 C. Storing information in applets.
 D. Loading buttons and menus.

_______
1 As used on this web site, the terms "Java virtual machine" or "JVM" mean a virtual machine for the Java platform.