I came across a chapter review question as follows:
Q. Variables declared inside a method as final retain their value between invocations of the method in which they are defined (true/false).
A. The answer to this question is true (at least in
Java 1.2)
I tried to build a method which I could prove this to be true but could not. Is there anyone who has an example which can prove this concept? Although I can understand that a final variable would be considered a constant, it goes against my understanding of variable scope being limited to the method in which it is declared.