Answer:
Synchronize the bank account data in order to resolve race condition
Step-by-step explanation:
Race condition is an unwanted situation where 2 or more then 2 process/thread perform some operation on shared data.
In this case, two operation wants to change bank account data by performing two different operation on share data.
In order to resolve the race condition, We only need to allow one thread at a time to alter shared data (in our case bank account). So the other thread/process will wait for the first thread to finish its task.
From doing this, only on operation will occur on shared bank account, i.e. deposit or withdraw.
In java, to resolve race condition we put shared data into synchronized block. Which will prevent multiple threads to perform there tasks on shared data simultaneously.