This section describes how the setup and cleanup methods relate to one another using sample code fragments.

Note: The sample code fragments in this section are part of a complete program that provides a new object class, Stack, whose instances implement standard programming push down stacks. The program is illustrated in Sample Code for Setup/Cleanup Methods.