In reply to mukul1996:
Why would you expect the output to be 4,4 or 5,5? You are calling update() with a new value, which is updating the internal static value of ‘b’.
You have a race condition, so you could potentially have 4,5 or 5,4 but I’m not sure why you would expect something different.