created: 01/03/03

CHAPTER 74 — Recursion with Graphics

This chapter builds an applet that shows how complicated-appearing graphics may be created with recursive Java methods. The applet draws the snowflake figure from the first chapter on recursion.

Chapter Topics:

Most of the programs used to illustrate recursion in the previous chapters could easily be written using iteration in place of recursion. Of course, it is always possible to use one instead of the other. Sometimes iteration is the obvious choice; sometimes recursion. This chapter discusses an applet that is much easier to write with recursion.

You may wish to review the first chapter on applets (chapter 36) if your recollection of applets is hazy.

QUESTION 1:

(Hazy Review: ) What is the method of an applet that is called by a Web browser when it needs to fill in the part of the screen that contains the applet?