A good answer might be:No. The formal parameter amount belongs to the processDeposit method. It cannot be used by any other method. | |
Scope of a Formal ParameterThe scope of a formal parameter (and later on, of a local variable) is the section of code that can "see" (can use) the parameter. The scope of a formal parameter is the body of its method. For example, the scope of amount is the body of its method:
The display() method cannot "see" amount because it is outside the scope of amount. The compiler will not compile this modified program. | |
QUESTION 5:Can the display() method see the object's instance variables (such as balance)? Click Here after you have answered the question |