Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Dive into the depths of Java with our quiz based on "Thinking in Java, Fourth Edition" by Bruce Eckel. Test your knowledge, solidify concepts, and prepare for certification with challenging questions and insightful feedback.

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What kind of graphics object is used to draw lines in a SWT scribble application?

  1. Canvas

  2. PaintBrush

  3. GC

  4. Drawable

The correct answer is: PaintBrush

The correct answer is B. In SWT scribble applications, PaintBrushes are used to draw lines because they allow for the creation and customization of strokes with different colors, widths, and styles. Canvases (A) are used to create and manipulate graphical objects, but they do not have the ability to draw lines. GCs (C) are the graphics context objects that are responsible for drawing graphics, but they are not used specifically for drawing lines in SWT scribble applications. Drawables (D) are abstract objects used to represent graphical objects, but they are also not used for drawing lines in this type of application. Therefore, the most appropriate answer is B, PaintBrush.