Let's say you have a variable (let String Str say) and the value of str starts as "and then when some code works, it is set to" test "and then somewhere else in the code, it changes again to say “tester.” Now in the program I want to know what the previous value of Str is. Is this possible in Java?
So, I say that a variable changes twice, and you want to know what Str is before it is changed a second time. Thus, in the above example, the last value of Str would be a “tester”, but I wanted to find out what Str was before (if you did not know what it was before it was changed to a tester), in this case I would like to be able to find out that Str was a "test".
Is it possible to do this in Java?
source
share