created 01/22/00

on Applets

This is a practice quiz. The results are not recorded anywhere and do not affect your grade. The questions on this quiz might not appear in any quiz or test that does count toward your grade.

Instructions: For each question, choose the single best answer. Make your choice by clicking on a button. You can change your answers at any time. (When the quiz is graded, the correct answers will appear in the box after each question.)

1. Why does an applet have no main() method?

a. The browser acts as the main. The applet provides methods for the browser.
b. The paint() method is like the main method for an applet.
c. Programs that do graphics don't need a main.
d. Only simple programs need a main.

2. What class must be extended when you code an applet?

a. AWT
b. JDK
c. Applet
d. Graphics

3. What is the role of the Graphics object?

a. It represents the area the applet can draw in and provides drawing methods.
b. It can be omitted, but is sometimes used for file i/o.
c. It represents the entire screen of the computer monitor.
d. It contains a list of commands from the browser to your applet.

4. The width and height of the drawing area correspond to coordinates:

a. X and Y, with (0,0) in the lower left corner
b. X and Y, with (0,0) in the upper left corner
c. Y and X, with (0,0) in the lower left corner
d. Y and X, with (0,0) in the lower right corner

5. What is a location in a digital image called?

a. pipin
b. pickerel
c. pixel
d. pickel

6. Which of the following puts "Hello" starting at X=20 Y=50? Assume that graph holds a Graphics object reference.

a. drawString( "Hello", 20, 50 );
b. graph.drawString( 20, 50, "Hello" );
c. graph.println( "Hello" );
d. graph.drawString( "Hello", 20, 50 );

7. What set of tags is embedded in a text file to tell the browser how to treat each section of text?

b. TCP

8. Which of the following is a correct web page for the applet MyApplet?

<applet code="MyApplet.class">
<applet code="MyApplet.class"  width="250" height="200">
<applet code="MyApplet.class"  width="250" height="200">
<applet code="MyApplet.class"  width="250" height="200">

9. Which of the following draws a circle with a radius of 50 at X=10, Y=20?

a. graph.drawCircle( 50 );
b. graph.drawOval( 50, 50 );
c. graph.drawOval( 10, 20, 50, 50 );
d. graph.drawCircle( 50, 50, 10, 20 );

10. Which of the following sets the background color of the applet to white?

a. setColor( white );
b. setColor( Color.white );
c. setBackGround( Color.white );
d. setBackground( white );

The number you got right:       Percent Correct:       Letter Grade:   

Click here     Back to the main menu.