A good answer might be:Is this OK? Sure. The caller has sent the value 7000 to the method.
What does | |
Local VariablesA local variable is a variable that is declared inside of the body of a method. It can be seen only by the statements that follow its declaration inside of that method. (Its scope starts where it is declared and ends at the end of the method.) For example, charge of processCheck is a local variable:
The local variable charge is used in a typical fashion. It is used to hold a temporary value while something is being calculated. Local variables are not used to hold the permanent values of an object's state. They have a value only during the brief amount of time that a method is active. | |
QUESTION 9:Is the scope of a local variable always the entire body of a method? Click Here after you have answered the question |