prev next
  Course navigation
Module 3
Java graphics fundamentals - Quiz
Each question is worth one point. Some questions ask you to select the best answer, others ask you to select all the correct answers. To receive credit for questions asking for all the correct answers, you must select all the correct answers and only the correct answers.
1. What method in the Graphics class do you use to draw rectangles?
Please select the best answer.
  A. drawRectangle()
  B. drawRect()
  C. drawSquare()

2. If you want to display a scanned photograph in a Java applet, what image format is best to use?
Please select the best answer.
  A. JPEG
  B. GIF
  C. Windows bitmap

3. What method in the Applet class do you use to load an image?
Please select the best answer.
  A. loadImage()
  B. openImage()
  C. getImage()

4. Which one of the following lines of code properly invokes a method in the Graphicsclass to draw an image stored in the Image object named img at the position (10, 20)?
Please select the best answer.
  A. drawImage(img, 10, 20);
  B. drawImage(img, 10, 20, this);
  C. paintImage(img, 10, 20);

Score =
Correct answers: