createde: 01/22/00 revised: 10/04/03, 02/12/06

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 its 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.    JApplet
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?

A.    HTTP
B.    TCP
C.    HTML
D.    VRML

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

If you have returned here from another page, or have re-loaded this page, you will need to click again on each of your choices for the grading program to work correctly. You may want to press the SHIFT KEY while clicking to clear the old answers.