Quiz
The following questions test your knowledge of applets.
Questions
1: | What type of argument is used with the paint() method?
|
2: | Which method is handled right before an applet finishes running?
|
3: | Why can't all variables needed in an applet be created inside the init() method?
|
Answers
A1: | a. The Graphics object keeps track of the behavior and attributes needed to display things on-screen in the applet window. You might create a Graphics2 object inside the method, but it isn't sent as an argument. |
A2: | b. |
A3: | a. Variables that are used ... |
Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH EDITION now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.