previous | start | next

Answers

  1. Variables of both categories belong to methods–they come alive when the method is called, and they die when the method exits. They differ in their initialization. Parameter variables are initialized with the call values; local variables must be explicitly initialized.
  2. One instance field, named balance. Three local variables, one named harrysChecking and two named newBalance (in the deposit and withdraw methods); two parameter variables, both named amount (in the deposit and withdraw methods).

previous | start | next