This question is from
here
Question is :
These classes are defined in a single file. There’s a value object Account that carefully protects it’s state from concurrent access, a Client class of type
Thread that puts some money in an account, and a main method that simply starts two clients.
Just before the main method exits, the account’s number field is guaranteed to have value 2000.
1. true
2. false
As per the site answer is false. but as per my understanding it should be true. Because the execution will be terminate after the execution of both the thread is completed and both the methods of Account class are synchronized so the only one thread can execute the methods at a time. Can any one please explain why the answer is false. I have tried this example so may times but every time 2000 is the value of "number" field of Account class.