J2EEOnline J2EE   





Java Graphics  «Prev  Next»
Java graphics fundamentals - Quiz
Each question is worth one point. Select the best answer for each question.
 
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 Graphics class 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: