previous
|
start
|
next
Scenario to Explain Non-zero Result
t0
regains control and picks up where it left off.
t0
executes the lines
System.out.println(", new balance is " + newBalance); balance = newBalance;
The balance is now 100 instead of 0 because the deposit method used the OLD balance
This is called a race condition.
previous
|
start
|
next