Code this in Java
Use multithreading and thread synchronization to code anapplication simulating a bank deposit and withdrawal process. Setup an account containing an initial balance of $1000.00 with twoshared threads, Husband and Wife.When a thread makes a deposit in an account, the other thread mustwait. If the account balance is $0.00, no withdrawals arepermitted. Assume a deposit transaction requires 0.2 seconds tocomplete and a withdrawal transaction requires 0.5 seconds tocomplete. Generate random number 1 as deposit and 2 as withdrawal,respectively. Write a driver class MultiThreadAppto test your application, repeat and display the operations 50times. Document all source code with comments.
Answer
OR
OR